零散的记录,每条一句话,共 18 条。
ss -tnp state established 直接按状态过滤,不用 grep。
lsof -i :8080 或 ss -ltnp | grep 8080,后者不需要装 lsof。
python3 -m json.tool 或 jq .,比肉眼找括号靠谱。
diff -rq dir1 dir2,只列出不同的文件,不打印内容。
find . -type f -mmin -30,排查「刚刚谁动了什么」很好用。
tar --exclude='./node_modules' -czf x.tgz .,--exclude 要写在源路径前。
docker ps --format '{{.Ports}} {{.Names}}' | grep 8080。
find . -type d -exec chmod 755 {} +,用 + 比 \; 快很多。
openssl s_client -connect host:443 -servername host 2>/dev/null | openssl x509 -noout -dates。
cmd 2>&1 | tee -a out.log,排查时别只重定向。
ps aux --sort=-%mem | head,比 free 直观。
curl -sI https://example.com/,比 -v 干净。
python3 -m http.server 8000,临时分享文件够用。
iotop -oPa,只看有实际读写的进程。
改完 unit 文件要 systemctl daemon-reload,只 reload 服务不生效。
tar -tzf x.tgz | head -30,避免解压出一堆东西。
history | grep ssh,比翻 shell 记录快。
ls -lh 文件名 + file 文件名,两次确认再动手。