Linux/基礎命令

來自維基學院

類Unix操作系統需要一些基礎命令的知識使其工作。Unix®LinuxBSD等操作系統使用同一套基於單一UNIX規範和其它標準的命令集合。學習操作命令行界面是學習LinuxBSD的重中之中。

基礎命令[編輯 | 編輯原始碼]

命令 種類 描述 首次出現
alias 雜項 定義或展示命令別名
ar 雜項 創建和維護歸檔
at 進程管理 在稍後執行一個命令 Version 7 AT&T UNIX
awk 文字處理 基於模式匹配和處理的語言 Version 7 AT&T UNIX
basename 文件系統 返回不帶前綴的路徑名
bash Shell Bourne shell的後繼兼容版本
batch 進程管理 Schedule commands to be executed in a batch queue
bc 雜項 Arbitrary-precision arithmetic language
bg 進程管理 在後台運行命令
break Shell編程 for, while, 或until loop中退出
c99 C編程 編譯標準C程序
cal 雜項 顯示一個日曆 Version 5 AT&T UNIX
cat 文件系統 連接所有指定文件並將結果寫到標準輸出 Version 1 AT&T UNIX
cd 文件系統 改變工作目錄
cflow C編程 Generate a C-language flowgraph
chgrp 文件系統 改變文件所屬的組
chmod 文件系統 將每個文件的權限模式變更至指定模式 Version 1 AT&T UNIX
chown 文件系統 修改文件的所有者和/或所屬組為給定的所有者和/或組 Version 1 AT&T UNIX
chroot 進程 以指定的目錄作為運行指定命令時的的根目錄 Prior to 4.2BSD
cksum 文件系統 顯示或檢驗校驗和 4.4BSD
cmp 文件系統 比較兩個文件 Version 1 AT&T UNIX
comm 文字處理 逐行比較已排序的兩個文件文件 Version 4 AT&T UNIX
command Shell編程 執行一個簡單的命令
compress 文件系統 壓縮數據 4.3BSD
continue Shell編程 Continue for, while, or until loop
cp 文件系統 複製文件 Version 1 AT&T UNIX
crontab 雜項 Schedule periodic background work
csplit 文字處理 Split files based on context PWB UNIX
ctags C編程 Create a tags file 3.0BSD
cut Shell編程 從輸入文件中輸出指定部分到標準輸出
cxref C編程 Generate a C-language program cross-reference table
date 雜項 顯示當前日期和時間 Version 1 AT&T UNIX
dd 文件系統 轉換和複製一個文件
df 文件系統 報告磁盤剩餘空間 Version 1 AT&T UNIX
diff 文字處理 比較兩個文件
dirname 文件系統 返迴路徑名的目錄部分
dot Shell編程 Execute commands in the current environment
du 文件系統 估算文件空間使用量 Version 1 AT&T UNIX
echo Shell編程 將參數輸出到標準輸出
ed 文字處理 標準文本編輯器 Version 1 AT&T UNIX
env 雜項 列出環境變量或在修改變量後的環境中調用命令
eval Shell編程 Construct command by concatenating arguments
ex 文字處理 文本編輯器 BSD
exec Shell編程 Execute commands and open, close, or copy file descriptors
exit Shell編程 從Shell退出
expand 文字處理 Convert tabs to spaces 3.0BSD
export 雜項 Set the export attribute for variables
expr Shell編程 Evaluate arguments as an expression
false Shell編程 Return false value
fc 雜項 Process the command history list
fg 進程管理 切換後台進程到前台
file 文件系統 確定文件類型 Version 4 AT&T UNIX
find 文件系統 搜尋文件 Version 1 AT&T UNIX
flex C編程 Generate programs for lexical tasks
fold 文字處理 Filter for folding lines
fort77 C編程 w:FORTRAN compiler
fortune 雜項 Displays a random quotation
ftp Internet 互聯網文件傳輸程序
fuser 進程管理 List process IDs of all 進程 that have one or more files open
gawk 文字處理 Pattern scanning and processing language, GNU's version of awk
gencat 雜項 Generate a formatted message catalog
getconf 雜項 Get configuration values
getopts Shell編程 Parse utility options
grep 雜項 Search text for a pattern
groups 雜項 列出用戶所屬的所有組
hash 雜項 Remember or report utility locations
head 文字處理 將指定文件的開頭部分輸出到標準輸出 PWB UNIX
hostname 網絡 顯示系統的hostname
iconv 文字處理 Codeset conversion
id 雜項 輸出指定用戶的用戶信息和用戶組信息 4.4BSD
iostat 輸入/輸出信息 collect and show operating system storage input and output statistics
ipcrm 雜項 Remove a message queue, semaphore set, or shared memory segment identifier
ipcs 雜項 Report interprocess communication facilities status
jobs 進程管理 顯示當前會話的後台進程
join 文字處理 Relational database operator
kill 進程管理 結束進程或發送信號給進程 Version 3 AT&T UNIX
less 文字處理 Display files on a page-by-page basis
lex C編程 Generate programs for lexical tasks
link 文件系統 Call link function Version 1 AT&T UNIX
ln 文件系統 Link files Version 1 AT&T UNIX
locale 雜項 Get locale-specific information
localedef 雜項 Define locale environment
logger Shell編程 將消息輸入系統日誌
login 雜項 在系統上開始新會話
logname 雜項 Return the user's login name 4.4BSD
logout 雜項 在系統上退出會話
lp 文字處理 Send files to a printer
ls 文件系統 列出目錄內容 Version 1 AT&T UNIX
m4 雜項 Macro processor PWB UNIX
mailx 雜項 Process messages Version 1 AT&T UNIX
make 編程 Maintain, update, and regenerate groups of programs
man 雜項 Display system documentation
mesg 雜項 Permit or deny messages Version 1 AT&T UNIX
mkdir 文件系統 Make directories Version 1 AT&T UNIX
mkfifo 文件系統 Make FIFO special files 4.4BSD
mktemp 文件系統 Create a temporary file or directory
more 文字處理 Display files on a page-by-page basis
mount 文件系統 Mount a file system
mv 文件系統 移動文件 Version 1 AT&T UNIX
nano 文字編輯 對初學者友好的文字編輯器
netstat 網絡 Displays network information and statistics
newgrp 雜項 Change to a new group Version 6 AT&T UNIX
nice 進程管理 以指定的優先級運行命令 Version 4 AT&T UNIX
nl 文字處理 Line numbering filter
nm C編程 Write the name list of an object file
nohup 進程管理 Invoke a utility immune to hangups
od 雜項 Dump files in various formats Version 1 AT&T UNIX
passwd 系統 Set or change user password
paste 文字處理 Merge corresponding or subsequent lines of files Version 32V AT&T UNIX
patch 文字處理 Apply changes to files
pathchk 文件系統 Check pathnames
pax 雜項 Portable archive interchange 4.4BSD
pgrep 進程管理 Find 進程 with the given name using pattern matching
pkill 進程管理 Kills 進程 with the given name using pattern matching
pr 文字處理 Print files Version 1 AT&T UNIX
printf Shell編程 Write formatted output 4.3BSD-Reno
ps 進程管理 報告進程狀態 Version 4 AT&T UNIX
pstree 進程管理 顯示進程樹
pwd 文件系統 顯示工作目錄路徑
read Shell編程 Read a line from standard input
readonly 雜項 Set the readonly attribute for variables
renice 進程管理 Set nice values of running 進程 4.0BSD
return Shell編程 Return from a function
rm 文件系統 刪除文件或目錄 Version 1 AT&T UNIX
rmdir 文件系統 刪除目錄 Version 1 AT&T UNIX
sar 系統管理 System Activity Report Report System Activity
sed 文字處理 流編輯器 Version 7 AT&T UNIX
seq 雜項 Print a sequence of numbers
set 雜項 Set or unset options and positional parameters
sh Shell編程 Shell, the standard command language interpreter Version 7 AT&T UNIX
shift Shell編程 Shift positional parameters
shopt Shell編程 Control optional shell behavior
sleep Shell編程 暫停指定時間 Version 4 AT&T UNIX
sort 文字處理 對文本文件進行排序、合併或序列檢查
split 雜項 Split files into pieces Version 3 AT&T UNIX
strings C編程 Find printable strings in files
strip C編程 Remove unnecessary information from executable files
stty 雜項 Set the options for a terminal
suspend Shell編程 Suspend execution of the shell until it receives a continue signal
tabs 雜項 Set terminal tabs PWB UNIX
tail 文字處理 顯示指定文件的最後一部分並輸出至標準輸出 PWB UNIX
talk 雜項 與另一名用戶談話 4.2BSD
tee Shell編程 Duplicate standard input
test Shell編程 Evaluate expression
time 進程管理 Time a simple command Version 3 AT&T UNIX
times 進程管理 Write process times
touch 文件系統 Create file and Change file access and modification times Version 7 AT&T UNIX
top 進程管理 Real-time display of running 進程
tput 雜項 Change terminal characteristics System V
tr 文字處理 Translate characters Version 4 AT&T UNIX
trap 進程管理 Trap signals
true Shell編程 Return true value
tsort 文字處理 Topological sort Version 7 AT&T UNIX
tty 雜項 Return user's terminal name Version 1 AT&T UNIX
type 雜項 Displays how a name would be interpreted if used as a command
ulimit 雜項 Set or report file size limit
umask 雜項 Get or set the file mode creation mask
umount 文件系統 卸載一個文件系統
unalias 雜項 Remove alias definitions
uname 雜項 Return system name PWB UNIX
uncompress 雜項 Expand compressed data 4.3BSD
unexpand 文字處理 Convert spaces to tabs 3.0BSD
unget SCCS Undo a previous get of an SCCS file
unlink 文件系統 Call the unlink function Version 1 AT&T UNIX
unset 雜項 Unset values and attributes of variables and functions
uux 進程管理 Remote command execution
vi 文字處理 面向屏幕的文本編輯器 BSD
wait 進程管理 Await process completion
wc 文字處理 Word, line, and byte or character count Version 1 AT&T UNIX
who 系統管理 顯示登錄到系統的用戶 Version 1 AT&T UNIX
write 雜項 Write to another user's terminal Version 1 AT&T UNIX
xargs Shell編程 Construct argument lists and invoke utility PWB UNIX
yacc C編程 Yet another compiler compiler PWB UNIX
zcat 文字處理 解壓縮文件並顯示到標準輸出

類Unix[編輯 | 編輯原始碼]

就像RMS說的,「GNU的意思是GNU's Not Unix」。只有Unix®是真的Unix. LinuxBSD們則都是類Unix系統,儘管它們都不符合「官方」的Unix規範,但我們這裡研究的是一套歷史悠久的工具集合,我們將研究在大多數*nix環境中以類似方式運行的一般情況。