跳到正文
English

服务器常用命令速查

部署与排障时最常用的命令,持续补充。

DigitalScope1 min

linuxcheatsheet

☰ 本文目录(3 节)

进程与端口#

bash
sudo lsof -i :3000          # 谁占着端口ps aux | grep node          # 进程快照systemctl status nginx      # 服务状态journalctl -u nginx -n 100  # 最近 100 行日志

磁盘与内存#

bash
df -h                       # 磁盘du -sh /var/log/*           # 目录体积free -h                     # 内存htop                        # 交互式监控

网络#

bash
sudo ss -tlnp               # 监听端口curl -I https://blog.example.comtraceroute 1.1.1.1