总结Linux必会命令
图中总结了日常工作中Linux必然用到的多个命令,
共10个大类,包括:
浏览和文件系统
pwd Print current working directory
ls List directory contents
cd [dir] Change directory
tree Visualize directory structure
find [path] -name [file] Find files by name
文件操作
touch [file] Create empty file
rm [file] Remove file
rm -r [dir] Remove directory recursively
cp [src] [dest] Copy files/directories
mv [src] [dest] Move/rename files
文件查看
cat [file] Print file contents
less [file] Scrollable file viewer
head -n 10 [file] First 10 lines
tail -n 10 [file] Last 10 lines
tail -f [file] Follow live updates
文件权限
umask Default permission mask
stat [file] Display file permission info
chmod [mode] [file] Change file permissions
chown [user]:[group] [file] Change file owner and group
进程管理
ps aux List all processes
top Real time process monitor
htop Interactive process viewer
kill [PID] Kill process by ID
killall [name] Kill all by name
网络
ip a Show IP addresses
ping [host] Check connectivity
curl [url] Fetch URL content
wget [url] Download files
netstat -tuln List open ports
磁盘和存储
df -h Disk usage (human readable)
du -sh [dir] Directory size
lsblk List block devices
fdisk -l Show disk partitions
mount/umount Mount/Unmount filesystem
用户管理
whoami Show Current user
id Show user ID & groups
adduser [name] Add new user
passwd [user] Change password
groups [user] List user's groups
系统信息
uname -a Show System info
uptime System load & uptime
free -h Show RAM usage
dmesg Show Boot and kernel logs
搜索和文本
grep '[pattern]' [file] Search in files
awk '(print $1)' Text processing
sed 's/old/new/g' Replace text in stream
cut -d':' -f1 Split by delimiter
sort, uniq, wc -l
#linux# #编程# #计算机#
#程序员# #转码# #devops#
#互联网# #软件#
共10个大类,包括:
浏览和文件系统
pwd Print current working directory
ls List directory contents
cd [dir] Change directory
tree Visualize directory structure
find [path] -name [file] Find files by name
文件操作
touch [file] Create empty file
rm [file] Remove file
rm -r [dir] Remove directory recursively
cp [src] [dest] Copy files/directories
mv [src] [dest] Move/rename files
文件查看
cat [file] Print file contents
less [file] Scrollable file viewer
head -n 10 [file] First 10 lines
tail -n 10 [file] Last 10 lines
tail -f [file] Follow live updates
文件权限
umask Default permission mask
stat [file] Display file permission info
chmod [mode] [file] Change file permissions
chown [user]:[group] [file] Change file owner and group
进程管理
ps aux List all processes
top Real time process monitor
htop Interactive process viewer
kill [PID] Kill process by ID
killall [name] Kill all by name
网络
ip a Show IP addresses
ping [host] Check connectivity
curl [url] Fetch URL content
wget [url] Download files
netstat -tuln List open ports
磁盘和存储
df -h Disk usage (human readable)
du -sh [dir] Directory size
lsblk List block devices
fdisk -l Show disk partitions
mount/umount Mount/Unmount filesystem
用户管理
whoami Show Current user
id Show user ID & groups
adduser [name] Add new user
passwd [user] Change password
groups [user] List user's groups
系统信息
uname -a Show System info
uptime System load & uptime
free -h Show RAM usage
dmesg Show Boot and kernel logs
搜索和文本
grep '[pattern]' [file] Search in files
awk '(print $1)' Text processing
sed 's/old/new/g' Replace text in stream
cut -d':' -f1 Split by delimiter
sort, uniq, wc -l
#linux# #编程# #计算机#
#程序员# #转码# #devops#
#互联网# #软件#