官术网_书友最值得收藏!

Help for shell builtins

If you play around enough with man pages, you may notice that a lot of shell builtin commands do not have a man page. For instance, there is no man page for the cd or the exit commands:

elliot@ubuntu-linux:~$ type cd 
cd is a shell builtin
elliot@ubuntu-linux:~$ man cd
No manual entry for cd
elliot@ubuntu-linux:~$ type exit
exit is a shell builtin
elliot@ubuntu-linux:~$ man exit
No manual entry for exit

That's because shell builtin commands do not have man pages, but do not freak out just yet! You can still find help on how to use shell builtins by using the help command. For example, to get help on how to use the exit command, you can run:

elliot@ubuntu-linux:~$ help exit 
exit: exit [n]
Exit the shell.

Exits the shell with a status of N. If N is omitted, the exit status
is that of the last command executed.

Similarly, to get help on how to use the cd command, you can run the help cd command:

elliot@ubuntu-linux:~$ help cd 
cd: cd [-L|-P] [dir]
Change the shell working directory.

Change the current directory to DIR. The default DIR is the value of
the HOME shell variable.

The variable CDPATH defines the search path for the directory containing DIR.
Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory.
If DIR begins with a slash (/), then CDPATH is not used.

If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be a variable name. If that variable has a value,
its value is used for DIR.

Options:
-L force symbolic links to be followed
-P use the physical directory structure without following symbolic links
The default is to follow symbolic links, as if `-L' were specified.

Exit Status:
Returns 0 if the directory is changed; non-zero otherwise.

主站蜘蛛池模板: 芦山县| 黑山县| 湛江市| 德清县| 济阳县| 洛阳市| 石门县| 平潭县| 勃利县| 香河县| 蓝田县| 邵阳市| 颍上县| 南京市| 烟台市| 文安县| 工布江达县| 米脂县| 泌阳县| 乌拉特中旗| 肇州县| 南岸区| 法库县| 南江县| 呼和浩特市| 澜沧| 兴国县| 石泉县| 隆尧县| 益阳市| 商洛市| 黑河市| 井冈山市| 新郑市| 澄江县| 焉耆| 瑞昌市| 道孚县| 江口县| 玛多县| 东莞市|