文件和目录操作

命令 全拼 说明
ls list 列出目录内容
cd change directory 切换目录
pwd print working directory 显示当前工作目录
mkdir make directory 创建目录
rmdir remove directory 删除空目录
rm remove 删除文件或目录
cp copy 复制文件或目录
mv move 移动或重命名文件/目录
ln link 创建链接
find find 查找文件和目录
locate locate 快速定位文件
which which 查找命令的位置
whereis where is 查找二进制文件、源代码和手册页
du disk usage 显示目录空间使用情况
df disk free 显示磁盘空间使用情况

文件内容操作

命令 全拼 说明
cat concatenate 显示文件内容
more more 分页显示文件内容
less less 分页显示文件内容(功能更强)
head head 显示文件开头部分
tail tail 显示文件结尾部分
grep global regular expression print 文本搜索工具
sed stream editor 流编辑器
awk Aho, Weinberger, Kernighan 文本处理工具
sort sort 排序文本行
uniq unique 去除重复行
wc word count 统计字数、行数、字符数
cut cut 提取文本列
tr translate 字符转换
diff difference 比较文件差异

文件权限和属性

命令 全拼 说明
chmod change mode 修改文件权限
chown change owner 修改文件所有者
chgrp change group 修改文件所属组
umask user file-creation mode mask 设置默认权限掩码
stat status 显示文件详细信息
file file 确定文件类型

进程管理

命令 全拼 说明
ps process status 显示进程状态
top table of processes 实时显示进程信息
htop htop 交互式进程查看器
kill kill 终止进程
killall kill all 按名称终止进程
jobs jobs 显示作业状态
bg background 将作业放入后台
fg foreground 将作业调到前台
nohup no hang up 不挂断地运行命令

系统信息

命令 全拼 说明
uname unix name 显示系统信息
whoami who am i 显示当前用户名
id identification 显示用户和组ID
who who 显示当前登录用户
w who 显示登录用户及其活动
uptime up time 显示系统运行时间
date date 显示或设置日期
cal calendar 显示日历
free free 显示内存使用情况
lscpu list cpu 显示CPU信息
lsblk list block devices 列出块设备
lsusb list usb 列出USB设备
lspci list pci 列出PCI设备

网络相关

命令 全拼 说明
ping packet internet groper 测试网络连通性
wget web get 下载文件
curl client URL 传输数据工具
ssh secure shell 安全远程登录
scp secure copy 安全复制文件
rsync remote sync 远程同步
netstat network statistics 显示网络连接状态
ss socket statistics 显示套接字统计
ifconfig interface configuration 配置网络接口
ip internet protocol 网络配置工具

压缩和归档

命令 全拼 说明
tar tape archive 归档文件
gzip gnu zip 压缩文件
gunzip gnu unzip 解压缩文件
zip zip 创建zip压缩包
unzip unzip 解压zip文件

文本编辑器

命令 全拼 说明
vi visual 文本编辑器
vim vi improved 改进版vi编辑器
nano nano 简单文本编辑器
emacs editing macros 功能强大的编辑器

系统服务

命令 全拼 说明
systemctl system control 系统服务控制
service service 服务控制(旧版)
crontab cron table 定时任务表
su substitute user 切换用户
sudo substitute user do 以其他用户身份执行命令

输入输出重定向

命令 全拼 说明
tee tee 将输出同时写入文件和屏幕
xargs extended arguments 构建和执行命令行

其他常用命令

命令 全拼 说明
man manual 显示命令手册
info information 显示信息文档
help help 显示帮助信息
history history 显示命令历史
alias alias 创建命令别名
echo echo 输出文本
printf print formatted 格式化输出
sleep sleep 延迟指定时间
watch watch 周期性执行命令
clear clear 清屏
exit exit 退出shell
logout logout 注销

其他 Linux 命令缩写

bin = Binaries (二进制文件)

/dev = Devices (设备)

/etc = Etcetera (等等)

/lib = LIBrary

/proc = Processes

/sbin = Superuser Binaries (超级用户的二进制文件)

/tmp = Temporary (临时)

/usr = Unix Shared Resources

/var = Variable (变量)

FIFO = First In, First Out

GRUB = GRand Unified Bootloader

IFS= Internal Field Seperators

LILO = LInux LOader

MySQL = My 是最初作者女儿的名字,

SQL = Structured QueryLanguage

PHP = Personal Home Page Tools = PHP HypertextPreprocessor

PS = Prompt String

Perl = “Pratical Extraction and Report Language”(实际的抽取和报告语言) =”Pathologically Eclectic Rubbish Lister”

Python 得名于电视剧Monty Python’s Flying Circus

Tcl = Tool Command Language

Tk = ToolKit

VT = Video Terminal

YaST = Yet Another Setup Tool

apache = “a patchy” server

apt = Advanced Packaging Tool

ar = archiver

as = assembler

awk = “Aho Weiberger and Kernighan”三个作者的姓的第一个字母

bash = Bourne Again SHell

bc = Basic (Better) Calculator

bg = BackGround

biff = 作者HeidiStettner在U.C.Berkely养的一条狗,喜欢对邮递员汪汪叫。

cal = Calendar (日历)

cat = Catenate (链接)

cd = Change Directory

chgrp = Change Group

chmod = Change Mode

chown = Change Owner

chsh = Change Shell

cmp = compare

cobra = Common Object Request BrokerArchitecture

comm = common

cp = Copy

cpio = CoPy In and Out

cpp = C Pre Processor

cron = Chronos 希腊文时间

cups = Common Unix Printing System

cvs = Current Version System

daemon = Disk And Execution MONitor

dc = Desk Calculator

dd = Disk Dump (磁盘转储)

df = Disk Free

diff = Difference

dmesg = diagnostic message

du = Disk Usage

ed = editor

egrep = Extended GREP

elf = Extensible Linking Format

elm = ELectronic Mail

emacs = Editor MACroS

eval = EVALuate

ex = EXtended

exec = EXECute (执行)

fd = file descriptors

fg = ForeGround

fgrep = Fixed GREP

fmt = format

fsck = File System ChecK

fstab = FileSystem TABle

fvwm = F*** Virtual Window Manager

gawk = GNU AWK

gpg = GNU Privacy Guard

groff = GNU troff

hal = Hardware Abstraction Layer

joe = Joe’s Own Editor

ksh = Korn SHell

lame = Lame Ain’t an MP3 Encoder

lex = LEXical analyser

lisp = LISt Processing = Lots of IrritatingSuperfluous Parentheses

ln = Link

lpr = Line PRint

ls = list

lsof = LiSt Open Files

m4 = Macro processor Version 4

man = MANual pages

mawk = Mike Brennan’s AWK

mc = Midnight Commander

mkfs = MaKe FileSystem

mknod = Make Node

motd = Message of The Day

mozilla = MOsaic GodZILLa

mtab = Mount TABle

mv = Move

nano = Nano’s ANOther editor

nawk = New AWK

nl = Number of Lines

nm = names

nohup = No HangUP

nroff = New ROFF

od = Octal Dump

passwd = Passwd

pg = pager

pico = PIne’s message COmposition editor

pine = “Program for Internet News &Email” = “Pine is not Elm”

ping = 拟声 又 = Packet Internet Grouper

pirntcap = PRINTer CAPability

popd = POP Directory

pr = pre

printf = Print Formatted

ps = Processes Status

pty = pseudo tty

pushd = PUSH Directory

pwd = Print Working Directory

rc = runcom = run command, rc还是plan9的shell

rev = REVerse

rm = ReMove

rn = Read News

roff = RunOFF

rpm = RPM Package Manager = RedHat PackageManager

rsh, rlogin, rvim中的

r = Remote

rxvt = ouR XVT

seamoneky = 我

sed = Stream Editor

seq = SEQuence

shar = Shell ARchive

slrn = S-Lang rn

ssh = Secure Shell

ssl = Secure Sockets Layer

stty = Set TTY

su = Substitute User

svn = SubVersion

tar = Tape ARchive

tcsh = TENEX C shell

tee = T (T形水管接口)

telnet = TEminaL over Network

termcap = terminal capability

terminfo = terminal information

tex = τέχνη的缩写,希腊文art

tr = traslate

troff = Typesetter new ROFF

tsort = Topological SORT

tty = TeleTypewriter

twm = Tom’s Window Manager

tz = TimeZone

udev = Userspace DEV

ulimit = User’s LIMIT

umask = User’s MASK

uniq = UNIQue

i = VIsual = Very Inconvenient

vim = Vi IMproved

wall = write all

wc = Word Count

wine = WINE Is Not an Emulator

xargs = eXtended ARGuments

xdm = X Display Manager

xlfd = X Logical Font Description

xmms = X Multimedia System

xrdb = X Resources DataBase

xwd = X Window Dump

yacc = yet another compiler compiler

Fish = the Friendly Interactive SHell

su = Switch User

MIME = Multipurpose Internet Mail Extensions

ECMA = European Computer ManufacturersAssociation