Summary of basic operation and maintenance commands

The following commands are just a simple list, and there is no need to write specific usage. If you need to know the specific command usage, you can directly man command or commond --help to view the help information. If the word command not found appears when running the command, it means that you need to install the corresponding software package.

1. File, directory and file operation commands

ls: full spell list, the function is to list the content of the directory and its content attribute information.

pwd: full spell print working directory, its function is to display the absolute path of the current working directory

cd: spell change directory, the function is to switch from the current working directory to the specified working directory

cp: full spell copy, its function is to copy files or directories

scp: scp is the abbreviation of secure copy, scp is a secure remote file copy command based on ssh login under linux system

wget: used to download files from the specified URL

mkdir: create directory

rmdir: delete directory (empty directory)

rm: delete a file or folder

stat: View detailed information of a file or directory (including mtime, etc.)

du: View file and directory size

mv: move directories and files

touch: create empty file

find: find files that meet the criteria

tree: Display the contents of the directory in a tree structure


less: Pagination to display file contents

more: Pagination to display file content, the opposite of less

vi: edit file

vim:编辑文件(vi的升级版)

tail:显示文件内容的尾部

cut: 将文件的每一行按指定分隔符分割并输出

sort:对文件的文本内容排序

uniq:去除重复行

wc:统计文件的行数、单词数或字节数

tar:打包

zip:压缩

unzip:解压缩

gzip:压缩

whereis:查找二进制命令,按环境变量 PATH 路径查找

which:查找二进制命令,按环境变量 PATH 路径查找

locate:从数据库 (/var/lib/mlocate/mlocate.db) 查找命令,使用 updatedb 更新库

chmod:修改文件权限(读写执行)


2、系统和网络相关命令
uname: 显示操作系统相关信息的命令

free:查看系统内存

df:报告文件系统磁盘空间的使用情况

top:实时显示系统资源使用情况

iostat:统计系统 IO

date:查看和修改系统时间

cal:查看日历

uptime:显示系统运行时间及负载

hostname:查看和修改系统命名

ifconfig(ip addr):查看和修改网络配置

ifup:启动网卡

ifdown:关闭网卡

netstat:查看网络状态

telnet:使用telnet协议远程登录

ssh:使用ssh协议远程登录

ping:使用ping命令测试主机连通性

route:  查看及修改路由信息

lsof:全名 list open files,也就是列举系统中已经被打开的文件

dig:查找 DNS 解析过程

traceroute:追踪数据传输路由状况

fdisk:查看磁盘信息,为磁盘分区

mkfs:格式化磁盘分区

mount:挂载分区

umount:卸载分区

who:显示目前登录系统的用户信息

last:显示登入系统的用户


service(systemctl):查看及修改服务状态

chkconfig:查看及修管理 Linux 系统开机启动项

init :切换运行级别

shutdown:关机

halt:关机

poweroff:关机

logout:退出当前登录shell

exit:退出当前登录shell

Ctrl + d:退出当前登录shell(快捷键)

kill:杀掉进程

ps:显示进程的快照

crontab:查看及修改定时任务

nohup:忽略挂起信号运行指定命令(后台运行进程)


3、用户和组相关
useradd:新建用户

userdel:删除用户

groupadd:新建组

groupdel:删除组

passwd:修改用户登录命令

chown:修改文件所属者所属组

chgrp:更改文件用户组

chage:修改用户密码有效期限

su:切换用户

sudo:在root用户级别下执行命令


4、内置命令及其他

echo:打印变量,或直接输出指定的字符串

print:将结果输出到标准输出

printf:将结果格式化输出到标准输出

rpm:管理rpm包

yum:自动化管理rpm包

clear:清除屏幕,简称清屏

xargs:将标准输入转换成命令行参数

exec:调用并执行指令的命令

set:设置变量或函数

unset:删除变量或函数

type:查看文件类型


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325217377&siteId=291194637