- Learn Linux Quickly
- Ahmed AlKabary
- 321字
- 2021-06-11 18:43:51
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.
推薦閱讀
- Building a RESTful Web Service with Spring
- PHP程序設(shè)計(jì)(慕課版)
- Python 深度學(xué)習(xí)
- CouchDB and PHP Web Development Beginner’s Guide
- 零基礎(chǔ)輕松學(xué)SQL Server 2016
- C語言程序設(shè)計(jì)
- 零基礎(chǔ)入門學(xué)習(xí)Python(第2版)
- 從零開始學(xué)C#
- Mastering Web Application Development with AngularJS
- 網(wǎng)絡(luò)數(shù)據(jù)采集技術(shù):Java網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)
- Mastering VMware Horizon 7(Second Edition)
- Arduino電子設(shè)計(jì)實(shí)戰(zhàn)指南:零基礎(chǔ)篇
- Mastering SciPy
- Oracle Database XE 11gR2 Jump Start Guide
- Web開發(fā)新體驗(yàn)