

ls
ls -l # 详细信息
ls -a # 显示隐藏文件
ls -lh # 以人类可读方式显示大小
📌 常用组合:
ls -alh
cd /etc
cd ..
cd ~
cd -
pwd
touch file.txt
mkdir dir
mkdir -p a/b/c
rm file.txt
rm -r dir
rm -rf dir
🚨 高危命令:
rm -rf /
cp file1 file2
cp -r dir1 dir2
mv file1 /tmp
cat file.txt
less file.txt
快捷键:
tail -f /var/log/messages
tail -100 file.log
head -20 file.txt
grep "error" file.log
grep -i "error" file.log
grep -r "nginx" /etc
组合神器:
ps -ef | grep nginx
find / -name "*.log"
find /var -size +100M
awk '{print $1}' file.txt
sed 's/old/new/g' file.txt
cat /etc/os-release
uname -a
lscpu
free -h
df -h
du -sh *
top
更强工具:
htop
ps -ef
kill PID
kill -9 PID
command &
ip addr
旧版本:
ifconfig
ping 8.8.8.8
ss -tunlp
旧命令:
netstat -tunlp
telnet 192.168.1.1 80
ip route
ls -l
权限结构:
-rwxr-xr--
chmod 755 file.sh
chmod +x file.sh
chown user:user file
useradd test
passwd test
lsblk
fdisk -l
mount /dev/sdb1 /mnt
umount /mnt
tar -czvf file.tar.gz dir
tar -xzvf file.tar.gz
zip -r file.zip dir
unzip file.zip
yum install nginx
dnf install nginx
apt update
apt install nginx
ss -tunlp | grep 80
top
tail -f /var/log/messages
systemctl status nginx
history
clear
alias ll='ls -alh'
watch -n 1 "df -h"