国产精品电影_久久视频免费_欧美日韩国产激情_成年人视频免费在线播放_日本久久亚洲电影_久久都是精品_66av99_九色精品美女在线_蜜臀a∨国产成人精品_冲田杏梨av在线_欧美精品在线一区二区三区_麻豆mv在线看

獲取有關(guān)Linux shell內(nèi)置命令的幫助

系統(tǒng) Linux
Linux 內(nèi)置命令屬于用戶 shell 的一部分,本文將告訴你如何識別它們并獲取使用它們的幫助。

 [[272147]]

Linux 內(nèi)置命令屬于用戶 shell 的一部分,本文將告訴你如何識別它們并獲取使用它們的幫助。

Linux 內(nèi)置命令是內(nèi)置于 shell 中的命令,很像內(nèi)置于墻中的書架。與標準 Linux 命令存儲在 /usr/bin 中的方式不同,你不會找到它們的獨立文件,你可能使用過相當多的內(nèi)置命令,但你不會感覺到它們與 lspwd 等命令有何不同。

內(nèi)置命令與其他 Linux 命令一樣使用,它們可能要比不屬于 shell 的類似命令運行得快一些。Bash 內(nèi)置命令包括 alias、exportbg 等。

正如你擔心的那樣,因為內(nèi)置命令是特定于 shell 的,所以它們不會提供手冊頁。使用 man 來查看 bg,你會看到這樣的東西:

  1. $ man bg
  2. No manual entry for bg

判斷內(nèi)置命令的另一個提示是當你使用 which 命令來識別命令的來源時,Bash 不會響應,表示沒有與內(nèi)置命令關(guān)聯(lián)的文件:

  1. $ which bg
  2. $

另一方面,如果你的 shell 是 /bin/zsh,你可能會得到一個更有啟發(fā)性的響應:

  1. % which bg
  2. bg: shell built-in command

bash 提供了額外的幫助信息,但它是通過使用 help 命令實現(xiàn)的:

  1. $ help bg
  2. bg: bg [job_spec ...]
  3. Move jobs to the background.
  4.  
  5. Place the jobs identified by each JOB_SPEC in the background, as if they
  6. had been started with `&'. If JOB_SPEC is not present, the shell's notion
  7. of the current job is used.
  8.  
  9. Exit Status:
  10. Returns success unless job control is not enabled or an error occurs.

如果你想要查看 bash 提供的所有內(nèi)置命令的列表,使用 compgen -b 命令。通過管道將命令輸出到列中,以獲得較好格式的清單。

  1. $ compgen -b | column
  2. . compgen exit let return typeset
  3. : complete export local set ulimit
  4. [ compopt false logout shift umask
  5. alias continue fc mapfile shopt unalias
  6. bg declare fg popd source unset
  7. bind dirs getopts printf suspend wait
  8. break disown hash pushd test
  9. builtin echo help pwd times
  10. caller enable history read trap
  11. cd eval jobs readarray true
  12. command exec kill readonly type

如果你使用 help 命令,你將看到一個內(nèi)置命令列表以及簡短描述。但是,這個列表被截斷了(以 help 命令結(jié)尾):

  1. $ help
  2. GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
  3. These shell commands are defined internally. Type `help' to see this list.
  4. Type `help name' to find out more about the function `name'.
  5. Use `info bash' to find out more about the shell in general.
  6. Use `man -k' or `info' to find out more about commands not in this list.
  7.  
  8. A star (*) next to a name means that the command is disabled.
  9.  
  10. job_spec [&] history [-c] [-d offset] [n] or histo>
  11. (( expression )) if COMMANDS; then COMMANDS; [ elif CO>
  12. . filename [arguments] jobs [-lnprs] [jobspec ...] or jobs ->
  13. : kill [-s sigspec | -n signum | -sigsp>
  14. [ arg... ] let arg [arg ...]
  15. [[ expression ]] local [option] name[=value] ...
  16. alias [-p] [name[=value] ... ] logout [n]
  17. bg [job_spec ...] mapfile [-d delim] [-n count] [-O ori>
  18. bind [-lpsvPSVX] [-m keymap] [-f filen> popd [-n] [+N | -N]
  19. break [n] printf [-v var] format [arguments]
  20. builtin [shell-builtin [arg ...]] pushd [-n] [+N | -N | dir]
  21. caller [expr] pwd [-LP]
  22. case WORD in [PATTERN [| PATTERN]...) > read [-ers] [-a array] [-d delim] [-i>
  23. cd [-L|[-P [-e]] [-@]] [dir] readarray [-d delim] [-n count] [-O o>
  24. command [-pVv] command [arg ...] readonly [-aAf] [name[=value] ...] or>
  25. compgen [-abcdefgjksuv] [-o option] [-> return [n]
  26. complete [-abcdefgjksuv] [-pr] [-DEI] > select NAME [in WORDS ... ;] do COMMA>
  27. compopt [-o|+o option] [-DEI] [name ..> set [-abefhkmnptuvxBCHP] [-o option-n>
  28. continue [n] shift [n]
  29. coproc [NAME] command [redirections] shopt [-pqsu] [-o] [optname ...]
  30. declare [-aAfFgilnrtux] [-p] [name[=va> source filename [arguments]
  31. dirs [-clpv] [+N] [-N] suspend [-f]
  32. disown [-h] [-ar] [jobspec ... | pid . <p&gt'> test [expr]
  33. echo [-neE] [arg ...] time [-p] pipeline
  34. enable [-a] [-dnps] [-f filename] [nam> times
  35. eval [arg ...] trap [-lp] [[arg] signal_spec ...]
  36. exec [-cl] [-a name] [command [argumen> true
  37. exit [n] type [-afptP] name [name ...]
  38. export [-fn] [name[=value] ...] or exp> typeset [-aAfFgilnrtux] [-p] name[=va>
  39. false ulimit [-SHabcdefiklmnpqrstuvxPT] [li>
  40. fc [-e ename] [-lnr] [first] [last] or> umask [-p] [-S] [mode]
  41. fg [job_spec] unalias [-a] name [name ...]
  42. for NAME [in WORDS ... ] ; do COMMANDS> unset [-f] [-v] [-n] [name ...]
  43. for (( exp1; exp2; exp3 )); do COMMAND> until COMMANDS; do COMMANDS; done
  44. function name { COMMANDS ; } or name (> variables - Names and meanings of som>
  45. getopts optstring name [arg] wait [-fn] [id ...]
  46. hash [-lr] [-p pathname] [-dt] [name .> while COMMANDS; do COMMANDS; done
  47. help [-dms] [pattern ...] { COMMANDS ; }

從上面的清單中可以看出,help 命令本身就是內(nèi)置的。

你可以通過向 help 命令提供你感興趣的內(nèi)置命令名稱來獲取關(guān)于它們的更多信息,例如 help dirs

  1. $ help dirs
  2. dirs: dirs [-clpv] [+N] [-N]
  3. Display directory stack.
  4.  
  5. Display the list of currently remembered directories. Directories
  6. find their way onto the list with the `pushd' command; you can get
  7. back up through the list with the `popd' command.
  8.  
  9. Options:
  10. -c clear the directory stack by deleting all of the elements
  11. -l do not print tilde-prefixed versions of directories relative
  12. to your home directory
  13. -p print the directory stack with one entry per line
  14. -v print the directory stack with one entry per line prefixed
  15. with its position in the stack
  16.  
  17. Arguments:
  18. +N Displays the Nth entry counting from the left of the list
  19. shown by dirs when invoked without options, starting with
  20. zero.
  21.  
  22. -N Displays the Nth entry counting from the right of the list
  23. shown by dirs when invoked without options, starting with
  24. zero.
  25.  
  26. Exit Status:
  27. Returns success unless an invalid option is supplied or an error occurs.

內(nèi)置命令提供了每個 shell 的大部分功能。你使用的任何 shell 都有一些內(nèi)置命令,但是如何獲取這些內(nèi)置命令的信息可能因 shell 而異。例如,對于 zsh,你可以使用 man zshbuiltins 命令獲得其內(nèi)置命令的描述。

  1. $ man zshbuiltins
  2.  
  3. ZSHBUILTINS(1) General Commands Manual ZSHBUILTINS(1)
  4.  
  5. NAME
  6. zshbuiltins - zsh built-in commands
  7.  
  8. SHELL BUILTIN COMMANDS
  9. Some shell builtin commands take options as described in individual en
  10. tries; these are often referred to in the list below as `flags' to avoid
  11. confusion with shell options, which may also have an effect on the behav‐
  12. iour of builtin commands. In this introductory section, `option' always
  13. has the meaning of an option to a command that should be familiar to most
  14. command line users.

在這個冗長的手冊頁中,你將找到一個內(nèi)置命令列表,其中包含有用的描述,如下摘錄中所示:

  1. bg [ job ... ]
  2. job ... &
  3. Put each specified job in the background, or the current job if
  4. none is specified.
  5.  
  6. bindkey
  7. See the section `Zle Builtins' in zshzle(1).
  8.  
  9. break [ n ]
  10. Exit from an enclosing for, while, until, select or repeat loop.
  11. If an arithmetic expression n is specified, then break n levels
  12. instead of just one.

最后

Linux 內(nèi)置命令對于每個 shell 都很重要,它的操作類似特定于 shell 的命令一樣。如果你經(jīng)常使用不同的 shell,并注意到你經(jīng)常使用的某些命令似乎不存在或者不能按預期工作,那么它可能是你使用的其他 shell 之一中的內(nèi)置命令。

責任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2018-02-24 15:40:06

LinuxBashShell

2010-03-02 09:14:00

Linux創(chuàng)建用戶命令

2019-12-01 22:59:43

Linux shell命令進程

2014-02-20 11:31:34

last命令審計工具

2011-01-18 13:53:42

Linux Shell命令

2014-07-31 11:24:21

Linuxshell命令

2010-03-23 15:24:45

Linux shell

2010-06-23 17:34:03

Linux Bash

2010-06-23 17:37:14

Linux Bash

2010-06-23 14:45:02

Linux Bash

2022-12-12 09:12:30

2014-09-17 10:20:20

Linuxshell

2019-10-24 07:57:37

Linuxshell獲取時間

2009-12-25 09:47:05

LinuxShell編程bash

2017-09-04 16:20:38

Linuxshell命令

2010-06-23 17:16:33

Linux Bash

2010-06-23 17:29:07

Linux Bash

2010-06-23 16:31:10

Linux Bash

2009-12-18 08:57:27

Linux shell

2013-09-18 10:21:20

命令Shell
點贊
收藏

51CTO技術(shù)棧公眾號

成人午夜av电影| 久久97精品久久久久久久不卡| av免费观看大全| 模特精品在线| 91久久久久久久久久| 精品人人人人| 国产网站欧美日韩免费精品在线观看| 成人在线免费电影| 一区二区三区国产豹纹内裤在线| 另类小说第一页| 91丝袜美腿高跟国产极品老师 | 久久精品国产2020观看福利| av毛片午夜不卡高**水| 91精品国产入口| 久久77777| 日韩小视频在线观看专区| 永久免费在线观看视频| 欧美午夜宅男影院| 免费在线毛片网站| 欧美亚洲一区二区在线观看| 国产在线日本| 欧美一区二区免费视频| 日本乱理伦在线| 精品伊人久久97| 深夜视频一区二区| 久久精品一偷一偷国产| 亚洲国产视频二区| 668精品在线视频| 日韩超碰人人爽人人做人人添| 欧美国产在线电影| 日韩美女毛片| 国产欧美欧洲在线观看| 欧美激情成人| 国产精品美女诱惑| 久久综合婷婷| 污污污污污污www网站免费| 91视频一区二区| hbad中文字幕| 一本久久综合亚洲鲁鲁五月天| 大地资源网3页在线观看| 亚洲国产97在线精品一区| 亚洲www.| 97国产一区二区精品久久呦| 欧美国产偷国产精品三区| 精品久久久久久乱码天堂| 久久国产精品无码网站| 毛片在线播放视频| 亚洲欧洲一区二区三区| 伊人影院在线播放| 欧美成va人片在线观看| 久久国内精品| 国产成人精品午夜| 亚洲看片一区| 国产一区二区视频播放| 亚洲激情五月婷婷| av网站导航在线观看免费| 中文字幕在线成人| jizzjizz欧美69巨大| 精品视频在线观看| 懂色一区二区三区免费观看| 免费观看一二区视频网站| 欧美日韩国产三级| 韩日精品一区| 成人性生交大片免费看视频直播| 久久亚洲国产精品一区二区| 91视频 -- 69xx| 欧美日韩国产页| 成人小电影网站| 日本精品免费观看| 久久成人18免费观看| 中文字幕av专区| 日韩三区在线观看| 精品国产一区二区三区成人影院 | 日本午夜精品久久久| 国产精品麻豆免费版| 95精品视频在线| 超碰免费在线| 欧美激情综合亚洲一二区| 亚洲黄色天堂| www.99re.av| 亚洲另类图片色| 中文字幕一区二区三区在线视频| 国产精品无码电影在线观看| 欧美日韩国产区| 99精品国产九九国产精品| 91网免费观看| 国产欧美日韩综合精品一区二区| 久久久久久久久免费视频| 97在线免费观看视频| 蜜臀av国产精品久久久久| 国产无遮挡又黄又爽免费网站| 日韩欧美成人一区二区| 国产一区二区三区91| 18禁裸男晨勃露j毛免费观看| 欧美性开放视频| jizz18欧美18| 轻点好疼好大好爽视频| 欧美日本一区二区三区四区| 精品国产精品久久一区免费式 | 久久久久久尹人网香蕉| 免费久久精品视频| 视频三区在线观看| 97人人模人人爽人人喊中文字| 国产资源在线一区| 成人高清网站| 日产精品99久久久久久| 成人高清在线视频| 福利在线导航136| 国产日韩在线一区二区三区| 亚洲精品视频免费看| 国产精品亚洲四区在线观看| 热久久最新地址| 亚洲大尺度美女在线| 国产一级一区二区| 成人亚洲综合天堂| 91亚洲精品丁香在线观看| 亚洲欧美国产77777| 亚洲视频资源| 国产高清www| 亚洲欧美国产日韩天堂区| 久久久一二三| 香蕉久久aⅴ一区二区三区| 丁香五月网久久综合| 亚洲精品成a人| 天美av一区二区三区久久| 毛片av免费在线观看| 久久久国产一区| 国产无遮挡一区二区三区毛片日本| 亚洲三级在线| 成人在线免费观看av| 色爱精品视频一区| 成人精品国产一区二区4080| 福利一区二区三区视频在线观看| 99热久久这里只有精品| 日韩在线免费视频| 91美女福利视频| 91精品久久久久久综合五月天| 日本老熟妇毛茸茸| 久久久久亚洲精品| 中文字幕在线不卡| 岳的好大精品一区二区三区| 日本性视频网| 亚洲一区二区自拍| 欧美性生活久久| 久久亚洲精品伦理| 亚洲欧美一区二区三区| 无码毛片aaa在线| 久久久精品网站| 日韩理论片一区二区| 精品中文字幕一区二区三区av| 成视人a免费观看视频| 国产精品久久久久不卡| 色婷婷综合五月| 老牛嫩草一区二区三区日本| 新版的欧美在线视频| 久久精品免费一区二区| 国模视频一区二区| 亚洲一区二区三区视频在线播放| 91亚洲人成网污www| 91福利在线视频| 在线观看欧美一区| 久久精品人人爽| 一区二区三区av电影| 狠狠入ady亚洲精品| 草美女在线观看| 久久综合久久色| 国产精品久久91| 欧美精品 国产精品| 精品一区二区三区久久| 日韩激情欧美| 欧洲亚洲在线| 久久精品国产精品亚洲精品色| 久久综合免费视频影院| 亚洲第一久久影院| 日韩精品一区第一页| 欧美日本三级| 久久经典视频| 国产精品视频二| 欧美在线激情网| 91精品综合久久久久久| 99久久国产综合精品色伊| jizzjizz欧美69巨大| 在线看女人毛片| 色爱综合网站| 欧美日韩一区在线播放| 欧美男插女视频| 欧美日本国产视频| 99天天综合性| 欧美精品麻豆| 高清国产一区二区三区四区五区| 欧美日韩影视| 欧美成人xxxxx| 精品国产乱码久久久久久88av | 91在线观看高清| 国产综合激情| 国产美女亚洲精品7777| 国产高清视频免费最新在线| 欧美黑人又粗又大又爽免费| 久久国产精品亚洲va麻豆| 欧美激情综合色综合啪啪五月|