Linux 常用命令
文件操作
# 查找文件
find / -name "*.conf" 2>/dev/null
# 磁盘使用
du -sh /var/log/*
df -h
# 实时查看日志
tail -f /var/log/syslog
进程管理
# 查看端口占用
ss -tlnp | grep :80
lsof -i :80
# 杀死进程
kill -9 $(lsof -t -i:80)
# 查看资源占用
htop
网络
# 测试连通性
curl -I https://example.com
traceroute example.com
# 防火墙 (ufw)
ufw allow 80/tcp
ufw status