Linux operation and maintenance personnel the most commonly used 166 Command Summary

command Function Description
Online inquiry, help command (2)
man View command help, command dictionary, as well as more complex info, but not commonly used.
help View help Linux built-in commands, such as cd commands.
File, directory operations command (18)
ls Spelling for the list, the function is to list the contents of a directory and its contents attribute information.
cd Spelling to change directory, function is to switch from the current working directory to the working directory specified.
cp Spelling to copy, copy function for the file or directory.
find Find, for finding directories and directory files.
mkdir Spelling to make directories, and its function is to create the directory.
mv Spelling for the move, its function is to move or rename files.
pwd Spelling to print working directory, function is to display the absolute path to the current working directory.
rename To rename the file.
rm Spelling to remove, its function is to delete one or more files or directories.
rmdir Spelling to remove empty directories, delete function is an empty directory.
touch Create an empty file, change the time stamp of the existing file attributes.
tree Function is based on a tree structure display contents of the directory.
basename Display the file name or the directory name.
dirname Display file or a directory path.
chattr Change the file extension attribute.
lsattr View files with extended attributes.
file Displays the file type.
md5sum MD5 value calculation and verification document.
View document content processing command (21)
cat Spelling to concatenate, for connecting a plurality of functions and the print files to a specified file or redirected to the screen output.
tac tac is cat's spelled backwards, so the command is the reverse function display file contents.
more Page display file contents.
less Pagination contrary usage contents of the file, more commands.
head Display the contents of the file header.
tail Display the contents of the file tail.
cut Each line of the file separators and outputs the divided specified.
split Files divided into different segments.
paste Row merge file contents.
sort Sort text file.
uniq To remove duplicate rows.
wc Statistics document the number of lines, words or bytes.
iconv Convert the file encoding format.
dos2unix Convert DOS format files to UNIX format.
diff 全拼为difference,比较文件差异,用于文本文件。
vimdiff 命令行可视化文件比较工具,用于文本文件。
rev 反向输出文件内容。
grep/egrep 常用于过滤字符串。
join 按两个文件的相同字段合并。
tr 替换、删除字符。
vi/vim 命令行文本编辑器。
文件压缩及解压缩命令(4个)
tar 打包压缩。
unzip 解压文件。
gzip 压缩工具。
zip 压缩工具。
信息显示命令(11个)
uname 显示操作系统相关信息。
hostname 显示或者设置当前系统的主机名。
dmesg 显示开机信息,用于诊断系统故障。
uptime 显示系统运行时间以及负载。
stat 显示文件或文件系统的状态。
du 计算磁盘空间使用情况。
df 报告文件系统磁盘空间使用情况。
top 实时显示系统资源使用情况。
free 查看系统内存。
date 显示、设置系统时间。
cal 查看日历、时间信息。
搜索文件命令(4个)
which 查找二进制文件的命令,按环境变量PATH路径查找。
find 从磁盘遍历查找文件或目录。
whereis 查找二进制文件的命令,按环境变量PATH路径查找。
locate 从数据库/var/lib/mlocate/mlocate.db中查找命令,使用updatedb更新库。
用户管理命令(10个)
useradd 添加用户。
usermod 修改系统已经存在用户属性。
userdel 删除用户。
groupadd 添加用户群组。
passwd 修改用户密码。
chage 修改用户密码有效期限。
id 查看用户的uid/gid及归属的用户群组。
su 切换用户身份。
visudo 编辑/etc/sudoers文件的专属命令。
sudo 以另外一用户身份(默认为root用户)执行事先在sudoers文件中允许的命令。
基础网络操作命令(11个
telnet 用TELNET协议远程登录。
ssh 用SSH加密协议远程登录。
scp 全拼为secure copy,用于不同主机之间复制文件。
wget 用命令行下载文件。
ping 测试主机之间网络的连通性。
route 显示和设置linux系统的路由表。
ifconfig 查看、配置、启用或禁用网络接口的命令。
ifup 启动网卡。
ifdown 关闭网卡。
netstat 查看网络状态。
ss 查看网络状态。
深入网络操作命令(9个)
nmap 网络扫描命令。
lsof 全名为list open files,也就是列举系统中已经被打开的文件。
mail 发送、接收邮件。
mutt 邮件管理命令。
nslookup 查询互联网DNS服务器的命令。
dig 查找DNS的解析过程。
host 查询DNS的命令。
traceroute 追踪数据传输路由状况。
tcpdump 命令行的抓包工具。
有关磁盘与文件系统的命令(16个)
mount 挂载文件系统。
umount 卸载文件系统。
fsck 检查并修复Linux文件系统。
dd 转换、复制文件。
dumpe2fs 导出ext2/ext3/ext4等文件系统信息。
dump ext2/3/4等文件系统备份工具。
fdisk 磁盘分区命令,适用于2TB以下磁盘分区。
parted 磁盘分区命令,没有磁盘大小限制,常用于2TB以下磁盘分区。
mkfs 格式化创建Linux文件系统。
partprobe 更新内核的硬盘分区表信息。
e2fsck 检查ext2/ext3/ext4等类型文件系统。
mkswap 创建Linux的交换分区。
swapon 启用交换分区。
swapoff 关闭交换分区。
sync 将内存缓冲区内的数据写入磁盘。
resize2fs 调整ext2/ext3/ext4等文件系统大小。
系统权限、用户授权相关命令(4个)
chmod 改变文件、目录权限。
chown 改变文件、目录的属主和属组。
chgrp 更改文件用户群组。
umask 显示、设置权限掩码。
查看系统用户登陆信息命令(7个)
whoami 显示当前有效用户名称,相当于执行id -un命令。
who 显示目前已登录系统的用户信息。
w 显示已登陆系统的用户列表,并显示用户正在执行的指令。
last 显示已登入系统的用户。
lastlog 显示系统中所有用户最近一次的登录信息。
users 显示当前登录系统的所有用户的用户列表。
finger 查找、显示用户信息。
内置命令、其它(19个)
echo 打印变量,直接输出指定的字符串
printf 将结果格式化输出到标准输出中。
rpm 管理rpm包命令。
yum 自动化简单化地管理rpm包的命令。
watch 周期的执行给定的命令,并将命令的输出以全屏方式显示。
alias 设置系统别名。
unalias 取消系统别名。
date 查看、设置系统时间。
clear 清除屏幕,简称清屏。
history 查看命令执行的历史纪录。
eject 弹出光驱。
time 计算命令执行时间。
nc 功能强大网络工具。
xargs 将标准输入转换成命令行的参数。
exec 调用并执行指令的命令。
export 设置或者显示环境变量。
unset 删除变量、函数。
type 用于判断另外一个命令是否为内置的命令。
bc 命令行科学计算器
系统管理、性能监视命令(9个)
chkconfig 管理Linux系统开机启动项。
vmstat 虚拟内存统计。
mpstat 显示各个可用CPU的状态统计。
iostat 统计系统的IO。
sar 全面地获取系统CPU、运行队列、磁盘读写、分页、内存、 CPU中断和网络性能数据。
ipcs 用于报告Linux中进程间通信设施的状态,显示信息包括消息列表、共享内存和信号量信息。
ipcrm 用来删除一个或更多的消息队列、信号量集或者共享内存标识。
strace 用于诊断、调试Linux用户空间跟踪器。我们用它来监控用户空间进程和内核交互,比如系统调用、信号传递、进程状态变更。
ltrace 命令会跟踪进程库函数调用,它会显现哪个库函数被调用。
关机/重启/注销和查看系统信息的命令(6个)
shutdown 关机。
halt 关机。
poweroff 关闭电源。
logout 退出当前登录的Shell。
exit 退出当前登录的Shell。
Ctrl+d 退出当前登录的Shell的快捷键。
进程管理相关命令(15个)
bg 将一个后台暂停的命令,变成继续执行。
fg 将后台的命令调至前台继续运行。
jobs 查看当前有多少后台运行的命令。
kill 终止进程。
killall 通过进程名来终止进程。
pkill 通过进程名来终止进程。
crontab 定时任务命令。
ps 显示进程快照。
pstree 树形显示进程。
nice/renice 调整程序运行的优先级。
nohup 忽略挂起信号运行指定。
pgrep 查找匹配条件进程。
runlevel 查看系统当前运行级别。
init 切换运行级别。
service 启动、停止、重新启动、关闭系统服务,还可以显示所有系统服务的当前状态。

Guess you like

Origin www.cnblogs.com/Super-It/p/11348365.html
Recommended