国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Linux 終端操作命令(2)內(nèi)部命令

這篇具有很好參考價(jià)值的文章主要介紹了Linux 終端操作命令(2)內(nèi)部命令。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

Linux 終端操作命令(2)內(nèi)部命令,Linux,linux,運(yùn)維

Linux 終端操作命令

也稱(chēng)Shell命令,是用戶(hù)與操作系統(tǒng)內(nèi)核進(jìn)行交互的命令解釋器,它接收用戶(hù)輸入的命令并將其傳遞給操作系統(tǒng)進(jìn)行執(zhí)行,可分為內(nèi)部命令和外部命令。內(nèi)部命令是Shell程序的一部分,而外部命令是獨(dú)立于Shell的可執(zhí)行程序。

內(nèi)部命令

內(nèi)部命令,實(shí)際上是shell程序的一部分,由shell程序識(shí)別并在shell程序內(nèi)部完成運(yùn)行,通常在Linux系統(tǒng)加載運(yùn)行時(shí)shell就被加載并駐留在系統(tǒng)內(nèi)存中。內(nèi)部命令是寫(xiě)在bash源碼里面的,因?yàn)榻馕鰞?nèi)部命令shell不需要?jiǎng)?chuàng)建子進(jìn)程,其執(zhí)行速度比外部命令快。比如:alias, break, cd, echo, exit, pwd 等。

外部命令

外部命令是bash shell之外的程序,也并不是shell的一部分。外部命令位于/bin,/sbin, /usr/bin 或 /usr/sbin 等系統(tǒng)目錄中。外部命令是Linux系統(tǒng)中的實(shí)用程序部分,因?yàn)閷?shí)用程序的功能通常都比較強(qiáng)大,所以其包含的程序量也會(huì)很大,在系統(tǒng)加載時(shí)并不隨系統(tǒng)一起被加載到內(nèi)存中,而是在需要時(shí)才將其調(diào)用內(nèi)存。通常外部命令的實(shí)體并不包含在shell中,但是其命令執(zhí)行過(guò)程是由shell程序控制的。比如: awk, grep, ping,tar, vi 等。 除Linux系統(tǒng)自帶的外部命令,通常需要安裝對(duì)應(yīng)的程序包才能使用,內(nèi)部命令之外的所有可執(zhí)行程序都可以被認(rèn)作為外部命令。

內(nèi)外部命令區(qū)別

內(nèi)部命令在系統(tǒng)啟動(dòng)時(shí)就調(diào)入內(nèi)存,是常駐內(nèi)存的,所以執(zhí)行效率高。

外部命令是系統(tǒng)的軟件功能,用戶(hù)需要時(shí)才從硬盤(pán)中讀入內(nèi)存,執(zhí)行速度比內(nèi)部命令慢。

內(nèi)部命令列表

help命令可以列出所有內(nèi)部命令:

hann@HannYang:~$ help
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
These shell commands are defined internally. ?Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

?job_spec [&] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?history [-c] [-d offset] [n] or history -anrw [filename]>
?(( expression )) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMAN>
?. filename [arguments] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?jobs [-lnprs] [jobspec ...] or jobs -x command [args]
?: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? kill [-s sigspec | -n signum | -sigspec] pid | jobspec .>
?[ arg... ] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?let arg [arg ...]
?[[ expression ]] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?local [option] name[=value] ...
?alias [-p] [name[=value] ... ] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?logout [n]
?bg [job_spec ...] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mapfile [-d delim] [-n count] [-O origin] [-s count] [-t>
?bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u > ?popd [-n] [+N | -N]
?break [n] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? printf [-v var] format [arguments]
?builtin [shell-builtin [arg ...]] ? ? ? ? ? ? ? ? ? ? ? ? ? pushd [-n] [+N | -N | dir]
?caller [expr] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pwd [-LP]
?case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esa> ?read [-ers] [-a array] [-d delim] [-i text] [-n nchars] >
?cd [-L|[-P [-e]] [-@]] [dir] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?readarray [-d delim] [-n count] [-O origin] [-s count] [>
?command [-pVv] command [arg ...] ? ? ? ? ? ? ? ? ? ? ? ? ? ?readonly [-aAf] [name[=value] ...] or readonly -p
?compgen [-abcdefgjksuv] [-o option] [-A action] [-G globp> ?return [n]
?complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A act> ?select NAME [in WORDS ... ;] do COMMANDS; done
?compopt [-o|+o option] [-DEI] [name ...] ? ? ? ? ? ? ? ? ? ?set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
?continue [n] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?shift [n]
?coproc [NAME] command [redirections] ? ? ? ? ? ? ? ? ? ? ? ?shopt [-pqsu] [-o] [optname ...]
?declare [-aAfFgilnrtux] [-p] [name[=value] ...] ? ? ? ? ? ? source filename [arguments]
?dirs [-clpv] [+N] [-N] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?suspend [-f]
?disown [-h] [-ar] [jobspec ... | pid ...] ? ? ? ? ? ? ? ? ? test [expr]
?echo [-neE] [arg ...] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? time [-p] pipeline
?enable [-a] [-dnps] [-f filename] [name ...] ? ? ? ? ? ? ? ?times
?eval [arg ...] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?trap [-lp] [[arg] signal_spec ...]
?exec [-cl] [-a name] [command [arguments ...]] [redirecti> ?true
?exit [n] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?type [-afptP] name [name ...]
?export [-fn] [name[=value] ...] or export -p ? ? ? ? ? ? ? ?typeset [-aAfFgilnrtux] [-p] name[=value] ...
?false ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
?fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [c> ?umask [-p] [-S] [mode]
?fg [job_spec] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? unalias [-a] name [name ...]
?for NAME [in WORDS ... ] ; do COMMANDS; done ? ? ? ? ? ? ? ?unset [-f] [-v] [-n] [name ...]
?for (( exp1; exp2; exp3 )); do COMMANDS; done ? ? ? ? ? ? ? until COMMANDS; do COMMANDS; done
?function name { COMMANDS ; } or name () { COMMANDS ; } ? ? ?variables - Names and meanings of some shell variables
?getopts optstring name [arg] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?wait [-fn] [id ...]
?hash [-lr] [-p pathname] [-dt] [name ...] ? ? ? ? ? ? ? ? ? while COMMANDS; do COMMANDS; done
?help [-dms] [pattern ...] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? { COMMANDS ; }

通過(guò)整理以上內(nèi)容,得到 68 個(gè)命令、函數(shù)、變量以及控制指令:

1 alias alias [-p] [name[=value] ... ]
2 bg bg [job_spec ...]
3 bind bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u >
4 break break [n]
5 builtin builtin [shell-builtin [arg ...]]
6 caller caller [expr]
7 case case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esa>
8 cd cd [-L|[-P [-e]] [-@]] [dir]
9 command command [-pVv] command [arg ...]
10 compgen compgen [-abcdefgjksuv] [-o option] [-A action] [-G globp>
11 complete complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A act>
12 compopt compopt [-o|+o option] [-DEI] [name ...]
13 continue continue [n]
14 coproc coproc [NAME] command [redirections]
15 declare declare [-aAfFgilnrtux] [-p] [name[=value] ...]
16 dirs dirs [-clpv] [+N] [-N]
17 disown disown [-h] [-ar] [jobspec ... | pid ...]
18 echo echo [-neE] [arg ...]
19 enable enable [-a] [-dnps] [-f filename] [name ...]
20 eval eval [arg ...]
21 exec exec [-cl] [-a name] [command [arguments ...]] [redirecti>
22 exit exit [n]
23 export export [-fn] [name[=value] ...] or export -p
24 false false
25 fc fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [c>
26 fg fg [job_spec]
27 for

for NAME [in WORDS ... ] ; do COMMANDS; done?

for (( exp1; exp2; exp3 )); do COMMANDS; done

28 function function name { COMMANDS ; } or name () { COMMANDS ; }
29 getopts getopts optstring name [arg]
30 hash hash [-lr] [-p pathname] [-dt] [name ...]
31 help help [-dms] [pattern ...]
32 history history [-c] [-d offset] [n] or history -anrw [filename]>
33 if if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMAN>
34 jobs jobs [-lnprs] [jobspec ...] or jobs -x command [args]
35 kill kill [-s sigspec | -n signum | -sigspec] pid | jobspec .>
36 let let arg [arg ...]
37 local local [option] name[=value] ...
38 logout logout [n]
39 mapfile mapfile [-d delim] [-n count] [-O origin] [-s count] [-t>
40 popd popd [-n] [+N | -N]
41 printf printf [-v var] format [arguments]
42 pushd pushd [-n] [+N | -N | dir]
43 pwd pwd [-LP]
44 read read [-ers] [-a array] [-d delim] [-i text] [-n nchars] >
45 readarray readarray [-d delim] [-n count] [-O origin] [-s count] [>
46 readonly readonly [-aAf] [name[=value] ...] or readonly -p
47 return return [n]
48 select select NAME [in WORDS ... ;] do COMMANDS; done
49 set set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
50 shift shift [n]
51 shopt shopt [-pqsu] [-o] [optname ...]
52 source source filename [arguments]
53 suspend suspend [-f]
54 test test [expr]
55 time time [-p] pipeline
56 times times
57 trap trap [-lp] [[arg] signal_spec ...]
58 true true
59 type type [-afptP] name [name ...]
60 typeset typeset [-aAfFgilnrtux] [-p] name[=value] ...
61 ulimit ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
62 umask umask [-p] [-S] [mode]
63 unalias unalias [-a] name [name ...]
64 unset unset [-f] [-v] [-n] [name ...]
65 until until COMMANDS; do COMMANDS; done
66 variables variables - Names and meanings of some shell variables
67 wait wait [-fn] [id ...]
68 while while COMMANDS; do COMMANDS; done

注意,有些命令格式比較長(zhǎng)的都被截短了,如bind, case 等命令最后顯示的是 > 字符。

要想個(gè)辦法,做一個(gè)比較完整的內(nèi)部命令列表:

1. 把上表第2列,寫(xiě)入一個(gè)文本文件,比如 list.txt

2. 用vi編寫(xiě)一段shell代碼,如 lists.sh

hann@HannYang:~$ cat lists.sh?

#!/bin/bash

# 指定文本文件路徑
file_path="list.txt"

# 打開(kāi)文本文件并遍歷每一行
while IFS= read -r line; do
  # 獲取幫助信息并輸出
  help -s "$line"  >> commands.txt
done < "$file_path"

echo "done!"

3. 執(zhí)行,遍歷list.txt列出完整命令格式,寫(xiě)入列表文件 commands.txt

hann@HannYang:~$ bash lists.sh

4. 列出所有命令格式

hann@HannYang:~$ cat -n commands.txt
? ? ?1 ?alias: alias [-p] [name[=value] ... ]
? ? ?2 ?bg: bg [job_spec ...]
? ? ?3 ?bind: bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]
? ? ?4 ?break: break [n]
? ? ?5 ?builtin: builtin [shell-builtin [arg ...]]
? ? ?6 ?caller: caller [expr]
? ? ?7 ?case: case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
? ? ?8 ?cd: cd [-L|[-P [-e]] [-@]] [dir]
? ? ?9 ?command: command [-pVv] command [arg ...]
? ? 10 ?compgen: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] ?[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]
? ? 11 ?complete: complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] ?[-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
? ? 12 ?compopt: compopt [-o|+o option] [-DEI] [name ...]
? ? 13 ?continue: continue [n]
? ? 14 ?coproc: coproc [NAME] command [redirections]
? ? 15 ?declare: declare [-aAfFgilnrtux] [-p] [name[=value] ...]
? ? 16 ?dirs: dirs [-clpv] [+N] [-N]
? ? 17 ?disown: disown [-h] [-ar] [jobspec ... | pid ...]
? ? 18 ?echo: echo [-neE] [arg ...]
? ? 19 ?enable: enable [-a] [-dnps] [-f filename] [name ...]
? ? 20 ?eval: eval [arg ...]
? ? 21 ?exec: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]
? ? 22 ?exit: exit [n]
? ? 23 ?export: export [-fn] [name[=value] ...] or export -p
? ? 24 ?false: false
? ? 25 ?fc: fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]
? ? 26 ?fg: fg [job_spec]
? ? 27 ?for: for NAME [in WORDS ... ] ; do COMMANDS; done
? ? 28 ?function: function name { COMMANDS ; } or name () { COMMANDS ; }
? ? 29 ?getopts: getopts optstring name [arg]
? ? 30 ?hash: hash [-lr] [-p pathname] [-dt] [name ...]
? ? 31 ?help: help [-dms] [pattern ...]
? ? 32 ?history: history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
? ? 33 ?if: if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fi
? ? 34 ?jobs: jobs [-lnprs] [jobspec ...] or jobs -x command [args]
? ? 35 ?kill: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
? ? 36 ?let: let arg [arg ...]
? ? 37 ?local: local [option] name[=value] ...
? ? 38 ?logout: logout [n]
? ? 39 ?mapfile: mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
? ? 40 ?popd: popd [-n] [+N | -N]
? ? 41 ?printf: printf [-v var] format [arguments]
? ? 42 ?pushd: pushd [-n] [+N | -N | dir]
? ? 43 ?pwd: pwd [-LP]
? ? 44 ?read: read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
? ? 45 ?readarray: readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
? ? 46 ?readonly: readonly [-aAf] [name[=value] ...] or readonly -p
? ? 47 ?return: return [n]
? ? 48 ?select: select NAME [in WORDS ... ;] do COMMANDS; done
? ? 49 ?set: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
? ? 50 ?shift: shift [n]
? ? 51 ?shopt: shopt [-pqsu] [-o] [optname ...]
? ? 52 ?source: source filename [arguments]
? ? 53 ?suspend: suspend [-f]
? ? 54 ?test: test [expr]
? ? 55 ?time: time [-p] pipeline
? ? 56 ?times: times
? ? 57 ?trap: trap [-lp] [[arg] signal_spec ...]
? ? 58 ?true: true
? ? 59 ?type: type [-afptP] name [name ...]
? ? 60 ?typeset: typeset [-aAfFgilnrtux] [-p] name[=value] ...
? ? 61 ?ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
? ? 62 ?umask: umask [-p] [-S] [mode]
? ? 63 ?unalias: unalias [-a] name [name ...]
? ? 64 ?unset: unset [-f] [-v] [-n] [name ...]
? ? 65 ?until: until COMMANDS; do COMMANDS; done
? ? 66 ?variables: variables - Names and meanings of some shell variables
? ? 67 ?wait: wait [-fn] [id ...]
? ? 68 ?while: while COMMANDS; do COMMANDS; done

同樣,代碼中help的參數(shù)換成-d 就能得到命令的功能簡(jiǎn)介。

hann@HannYang:~$ cat lists.sh?

#!/bin/bash

# 指定文本文件路徑
file_path="list.txt"

rm commands.txt

# 打開(kāi)文本文件并遍歷每一行
while IFS= read -r line; do
  # 獲取幫助信息并輸出
  help -d "$line"  >> commands.txt
done < "$file_path"

echo "done!"

5. 列出所有命令簡(jiǎn)介

hann@HannYang:~$ cat -n commands.txt
? ? ?1 ?alias - Define or display aliases.
? ? ?2 ?bg - Move jobs to the background.
? ? ?3 ?bind - Set Readline key bindings and variables.
? ? ?4 ?break - Exit for, while, or until loops.
? ? ?5 ?builtin - Execute shell builtins.
? ? ?6 ?caller - Return the context of the current subroutine call.
? ? ?7 ?case - Execute commands based on pattern matching.
? ? ?8 ?cd - Change the shell working directory.
? ? ?9 ?command - Execute a simple command or display information about commands.
? ? 10 ?compgen - Display possible completions depending on the options.
? ? 11 ?complete - Specify how arguments are to be completed by Readline.
? ? 12 ?compopt - Modify or display completion options.
? ? 13 ?continue - Resume for, while, or until loops.
? ? 14 ?coproc - Create a coprocess named NAME.
? ? 15 ?declare - Set variable values and attributes.
? ? 16 ?dirs - Display directory stack.
? ? 17 ?disown - Remove jobs from current shell.
? ? 18 ?echo - Write arguments to the standard output.
? ? 19 ?enable - Enable and disable shell builtins.
? ? 20 ?eval - Execute arguments as a shell command.
? ? 21 ?exec - Replace the shell with the given command.
? ? 22 ?exit - Exit the shell.
? ? 23 ?export - Set export attribute for shell variables.
? ? 24 ?false - Return an unsuccessful result.
? ? 25 ?fc - Display or execute commands from the history list.
? ? 26 ?fg - Move job to the foreground.
? ? 27 ?for - Execute commands for each member in a list.
? ? 28 ?function - Define shell function.
? ? 29 ?getopts - Parse option arguments.
? ? 30 ?hash - Remember or display program locations.
? ? 31 ?help - Display information about builtin commands.
? ? 32 ?history - Display or manipulate the history list.
? ? 33 ?if - Execute commands based on conditional.
? ? 34 ?jobs - Display status of jobs.
? ? 35 ?kill - Send a signal to a job.
? ? 36 ?let - Evaluate arithmetic expressions.
? ? 37 ?local - Define local variables.
? ? 38 ?logout - Exit a login shell.
? ? 39 ?mapfile - Read lines from the standard input into an indexed array variable.
? ? 40 ?popd - Remove directories from stack.
? ? 41 ?printf - Formats and prints ARGUMENTS under control of the FORMAT.
? ? 42 ?pushd - Add directories to stack.
? ? 43 ?pwd - Print the name of the current working directory.
? ? 44 ?read - Read a line from the standard input and split it into fields.
? ? 45 ?readarray - Read lines from a file into an array variable.
? ? 46 ?readonly - Mark shell variables as unchangeable.
? ? 47 ?return - Return from a shell function.
? ? 48 ?select - Select words from a list and execute commands.
? ? 49 ?set - Set or unset values of shell options and positional parameters.
? ? 50 ?shift - Shift positional parameters.
? ? 51 ?shopt - Set and unset shell options.
? ? 52 ?source - Execute commands from a file in the current shell.
? ? 53 ?suspend - Suspend shell execution.
? ? 54 ?test - Evaluate conditional expression.
? ? 55 ?time - Report time consumed by pipeline's execution.
? ? 56 ?times - Display process times.
? ? 57 ?trap - Trap signals and other events.
? ? 58 ?true - Return a successful result.
? ? 59 ?type - Display information about command type.
? ? 60 ?typeset - Set variable values and attributes.
? ? 61 ?ulimit - Modify shell resource limits.
? ? 62 ?umask - Display or set file mode mask.
? ? 63 ?unalias - Remove each NAME from the list of defined aliases.
? ? 64 ?unset - Unset values and attributes of shell variables and functions.
? ? 65 ?until - Execute commands as long as a test does not succeed.
? ? 66 ?variables - Common shell variable names and usage.
? ? 67 ?wait - Wait for job completion and return exit status.
? ? 68 ?while - Execute commands as long as a test succeeds.

簡(jiǎn)單翻譯:

1 alias-定義或顯示別名。

2 bg-將作業(yè)移到后臺(tái)。

3 bind-設(shè)置Readline鍵綁定和變量。

4 break-退出循環(huán)、while或直到循環(huán)。

5 builtin-執(zhí)行shell內(nèi)建。

6 caller-返回當(dāng)前子例程調(diào)用的上下文。

7 case-基于模式匹配執(zhí)行命令。

8 cd-更改shell工作目錄。

9 command-執(zhí)行一個(gè)簡(jiǎn)單的命令或顯示有關(guān)命令的信息。

10 compgen-根據(jù)選項(xiàng)顯示可能的完成情況。

11 complete-指定Readline如何完成參數(shù)。

12 compopt-修改或顯示完成選項(xiàng)。

13 continue-繼續(xù)循環(huán)、while或直到循環(huán)。

14 coproc-創(chuàng)建一個(gè)名為NAME的協(xié)處理器。

15 declare-設(shè)置變量值和屬性。

16 dirs-顯示目錄堆棧。

17 disown-從當(dāng)前shell中刪除作業(yè)。

18 echo-將參數(shù)寫(xiě)入標(biāo)準(zhǔn)輸出。

19 enable-啟用和禁用shell內(nèi)置。

20 eval-將參數(shù)作為shell命令執(zhí)行。

21 exec-用給定的命令替換shell。

22 exit-退出外殼。

23 export-為shell變量設(shè)置導(dǎo)出屬性。

24 false-返回不成功的結(jié)果。

25 fc-顯示或執(zhí)行歷史列表中的命令。

26 fg-將作業(yè)移到前臺(tái)。

27 for-為列表中的每個(gè)成員執(zhí)行命令。

28 function-定義外殼函數(shù)。

29 getopts-分析選項(xiàng)參數(shù)。

30 hash-記住或顯示程序位置。

31 help-顯示有關(guān)內(nèi)置命令的信息。

32 history-顯示或操作歷史記錄列表。

33 if-根據(jù)條件執(zhí)行命令。

34 jobs-顯示作業(yè)的狀態(tài)。

35 kill-向工作發(fā)出信號(hào)。

36 let-評(píng)估算術(shù)表達(dá)式。

37 local-定義局部變量。

38 logout-退出登錄shell。

39 mapfile-將標(biāo)準(zhǔn)輸入中的行讀取到索引數(shù)組變量中。

40 popd-從堆棧中刪除目錄。

41 printf-在FORMAT的控制下格式化和打印參數(shù)。

42 pushd-將目錄添加到堆棧。

43 pwd-打印當(dāng)前工作目錄的名稱(chēng)。

44 read-從標(biāo)準(zhǔn)輸入中讀取一行,并將其拆分為字段。

45 readarray-將文件中的行讀取到數(shù)組變量中。

46 readonly-將shell變量標(biāo)記為不可更改。

47 return-從shell函數(shù)返回。

48 select-從列表中選擇單詞并執(zhí)行命令。

49 set-設(shè)置或取消設(shè)置外殼選項(xiàng)和位置參數(shù)的值。

50 shift-移位位置參數(shù)。

51 shopt-設(shè)置和取消設(shè)置外殼選項(xiàng)。

52 source-從當(dāng)前shell中的文件執(zhí)行命令。

53 suspend-掛起shell執(zhí)行。

54 test-評(píng)估條件表達(dá)式。

55 time-報(bào)告管道執(zhí)行所消耗的時(shí)間。

56 times-顯示處理時(shí)間。

57 trap-陷阱信號(hào)和其他事件。

58 true-返回成功的結(jié)果。

59 type-顯示有關(guān)命令類(lèi)型的信息。

60 typeset-設(shè)置變量值和屬性。

61 ulimit-修改shell資源限制。

62 umask-顯示或設(shè)置文件模式掩碼。

63 unalias-從定義的別名列表中刪除別名。

64 unset-取消設(shè)置shell變量和函數(shù)的值和屬性。

65 until-只要測(cè)試不成功,就執(zhí)行命令。

66 variables-常見(jiàn)的shell變量名稱(chēng)和用法。

67 wait-等待作業(yè)完成并返回退出狀態(tài)。

68 while-循環(huán)結(jié)構(gòu),只要測(cè)試為真就執(zhí)行命令。


文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-642485.html

到了這里,關(guān)于Linux 終端操作命令(2)內(nèi)部命令的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀(guān)點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • [linux]vncserver常用終端命令合集

    開(kāi)啟vnc服務(wù):systemctl start vncserver@:1.service 關(guān)閉vnc服務(wù):systemctl stop?vncserver@:1.service 重啟vnc服務(wù):systemctl restart vncserver@:1.service 設(shè)置VNC密碼: vncpasswd 開(kāi)啟VNC: vncserver :1 關(guān)閉VNC: vncserver -kill :1 查看vnc是否在進(jìn)程:ps -ef | grep vnc 查看5901端口是否在進(jìn)程:netstat -antulp | grep 5901 殺

    2024年04月26日
    瀏覽(25)
  • Linux 命令行終端快捷鍵匯整

    熟悉鍵盤(pán)操作可以極大地提高操作效率,熟練的 Linux 用戶(hù)幾乎不需要使用鼠標(biāo),僅用鍵盤(pán)就可以更快且更方便地完成所有操作。 Linux 命令解釋器(也可以叫 Shell,終端,命令行等)也有很多 快捷鍵 ,熟練掌握可以極大的提高操作效率。在本文整理一些最常用的 快捷鍵 。

    2024年03月28日
    瀏覽(53)
  • Linux和Shell筆記-3Linux系統(tǒng)內(nèi)部信息命令

    上一節(jié)匯總了Linux文件系統(tǒng)上切換目錄以及處理文件和目錄的基本知識(shí)。這里匯總通過(guò)命令行命令探查L(zhǎng)inux系統(tǒng)的內(nèi)部信息,包括: 管理進(jìn)程 獲取磁盤(pán)統(tǒng)計(jì)信息 掛載新磁盤(pán) 排序數(shù)據(jù) 歸檔數(shù)據(jù) 探查進(jìn)程(某個(gè)時(shí)間點(diǎn)) ps 實(shí)時(shí)監(jiān)測(cè)進(jìn)程 top 顯示的各個(gè)參數(shù)詳解top參數(shù) 結(jié)束進(jìn)程

    2024年02月16日
    瀏覽(18)
  • Linux 終端命令之文件瀏覽(1) cat

    Linux 終端命令之文件瀏覽(1) cat

    cat, more, less, head, tail,此五個(gè)文件瀏覽類(lèi)的命令皆為外部命令。 英文幫助 NAME ? ? ? ?cat - concatenate files and print on the standard output SYNOPSIS ? ? ? ?cat [OPTION]... [FILE]... DESCRIPTION ? ? ? ?Concatenate FILE(s) to standard output. ? ? ? ?With no FILE, or when FILE is -, read standard input. ? ? ? ?-A,

    2024年02月13日
    瀏覽(16)
  • Linux 終端命令之文件瀏覽(2) more

    Linux 終端命令之文件瀏覽(2) more

    cat, more, less, head, tail,此五個(gè)文件瀏覽類(lèi)的命令皆為外部命令。 英文幫助 NAME ? ? ? ?more - file perusal filter for crt viewing SYNOPSIS ? ? ? ?more [options] file... DESCRIPTION ? ? ? ?more ?is ?a ?filter ?for ?paging ?through text one screenful at a time. ?This version is especially primitive. ? ? ? ?Users sh

    2024年02月13日
    瀏覽(14)
  • Linux 終端命令之文件瀏覽(3) less

    Linux 終端命令之文件瀏覽(3) less

    cat, more, less, head, tail,此五個(gè)文件瀏覽類(lèi)的命令皆為外部命令。 英文幫助? NAME ? ? ? ?less - opposite of more SYNOPSIS ? ? ? ?less -? ? ? ? ?less --help ? ? ? ?less -V ? ? ? ?less --version ? ? ? ?less [-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~] ? ? ? ? ? ? [-b space] [-h lines] [-j line] [-k keyfile] ? ?

    2024年02月13日
    瀏覽(19)
  • Linux 運(yùn)維常用命令

    先說(shuō)些廢話(huà) 因?yàn)楣P者有著大量運(yùn)維部署站點(diǎn)的需求,所以之前一直在陸陸續(xù)續(xù)學(xué)習(xí)并實(shí)踐各種 Linux 的 Shell 命令,在此記錄一些高頻命令的使用的說(shuō)明,方便自己回顧加深記憶。 后期如果有用到一些新的命令,也會(huì)繼續(xù)保持更新,如果寫(xiě)的有不對(duì)的地方,也請(qǐng)各位看官指出,

    2024年02月16日
    瀏覽(28)
  • 【解決】Linux 桌面 無(wú)法打開(kāi)終端 一打就關(guān) 閃退 總是退出終端 自定義命令

    原本只是想要每次打開(kāi)終端,默認(rèn)是 zsh ,方便使用 oh-my-zsh。但誰(shuí)能料到這個(gè)配置有個(gè)史前大坑! 頂部菜單欄的 終端 首選項(xiàng)配置: 未命名 命令 運(yùn)行自定義命令 命令退出時(shí):退出終端。 只要這條命令出錯(cuò),或者執(zhí)行完畢,就會(huì)結(jié)束退出了 (太痛了!) 然后網(wǎng)上搜半天, 系統(tǒng)

    2024年02月09日
    瀏覽(16)
  • Linux 終端命令之文件瀏覽(4) head, tail

    Linux 終端命令之文件瀏覽(4) head, tail

    cat, more, less, head, tail,此五個(gè)文件瀏覽類(lèi)的命令皆為外部命令。 英文幫助 NAME ? ? ? ?head - output the first part of files SYNOPSIS ? ? ? ?head [OPTION]... [FILE]... DESCRIPTION ? ? ? ?Print the first 10 lines of each FILE to standard output. ?With more than one FILE, precede each with a header giving the file name. ? ?

    2024年02月11日
    瀏覽(17)
  • 如何在 Linux 和 Mac 終端命令中添加別名

    在本文中,我們將探討一種簡(jiǎn)單的技巧,可以節(jié)省您在終端中輸入重復(fù)命令的時(shí)間。 作為開(kāi)發(fā)者,我們花費(fèi)大量時(shí)間在終端上執(zhí)行命令。無(wú)論是瀏覽目錄、運(yùn)行腳本、更改 Node.js 版本還是版本控制命令,手動(dòng)輸入每個(gè)命令都是一項(xiàng)耗時(shí)的任務(wù)。 對(duì)于那些難以記住命令或其關(guān)

    2024年04月22日
    瀏覽(36)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包