从上面的清单中可以看出,help 命令本身就是内置的 。
你可以通过向 help 命令提供你感兴趣的内置命令名称来获取关于它们的更多信息,例如 help dirs:
$ help dirsdirs: dirs [-clpv] [+N] [-N] Display directory stack. Display the list of currently remembered directories. Directories find their way onto the list with the `pushd' command; you can get back up through the list with the `popd' command. Options: -c clear the directory stack by deleting all of the elements -l do not print tilde-prefixed versions of directories relative to your home directory -p print the directory stack with one entry per line -v print the directory stack with one entry per line prefixed with its position in the stack Arguments: +N Displays the Nth entry counting from the left of the list shown by dirs when invoked without options, starting with zero. -N Displays the Nth entry counting from the right of the list shown by dirs when invoked without options, starting with zero. Exit Status: Returns success unless an invalid option is supplied or an error occurs.内置命令提供了每个 shell 的大部分功能 。你使用的任何 shell 都有一些内置命令,但是如何获取这些内置命令的信息可能因 shell 而异 。例如,对于 zsh,你可以使用 man zshbuiltins 命令获得其内置命令的描述 。
$ man zshbuiltinsZSHBUILTINS(1) General Commands Manual ZSHBUILTINS(1)NAME zshbuiltins - zsh built-in commandsSHELL BUILTIN COMMANDS Some shell builtin commands take options as described in individual en‐ tries; these are often referred to in the list below as `flags' to avoid confusion with shell options, which may also have an effect on the behav‐ iour of builtin commands. In this introductory section, `option' always has the meaning of an option to a command that should be familiar to most command line users.…在这个冗长的手册页中,你将找到一个内置命令列表,其中包含有用的描述,如下摘录中所示:
bg [ job ... ]job ... & Put each specified job in the background, or the current job if none is specified.bindkey See the section `Zle Builtins' in zshzle(1).break [ n ] Exit from an enclosing for, while, until, select or repeat loop. If an arithmetic expression n is specified, then break n levels instead of just one.最后Linux 内置命令对于每个 shell 都很重要,它的操作类似特定于 shell 的命令一样 。如果你经常使用不同的 shell,并注意到你经常使用的某些命令似乎不存在或者不能按预期工作,那么它可能是你使用的其他 shell 之一中的内置命令 。
推荐阅读
- 注入与攻击测试篇 Kali Linux
- 3个技巧让你的公众号快速获取用户
- 和每个人健康都有关系的生物素 你了解么
- Python如何获取文件扩展名?
- 为何 Windows 系统用久会变慢,而 Linux 不会?
- 管理Linux不想用命令行?可以试试Webmin!最新CentOS8上体验一下
- python Linux下shell脚本监控Tomcat的状态并实现自动启动步骤
- Linux如何快速编写重启动脚本
- Linux系统使用iotop命令查看磁盘当前读写速度
- Linux的RPM 与 YUM
