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环境中以类似方式运行的一般情况。