CentOS 常用命令
1. 查看开机启动项
systemctl list-unit-files | grep enabled2. 查看服务状态
systemctl list-units --type=service | grep -E "nginx|php-fpm|mysql|memcached|syncthing"3. 查看服务进程
ps -ef | grep -E "nginx|php-fpm|mysql|memcached|syncthing"4. 查看监听端口
netstat -tunpl5. 查看开机启动项耗时
systemd-analyze blame6. 查看磁盘使用情况
df -h7. 查看目录大小
du -sh xxx8. 统计当前目录文件个数
ls -lR | grep "^-" | wc -l9. 查看 php-fpm 进程树
详见 /etc/php-fpm.conf 配置中 pm.max_children、pm.start_servers 等参数。
pstree | grep php-fpm10. 查看 php-fpm 慢日志
tail -f /var/log/php-fpm/www-slow.log11. 彻底卸载软件
查看最近安装的软件包并卸载
rpm -qa --last > ~/last.txt
yum list installed > ~/installed.txt
yum -y remove xxx
yum clean all查看是否有新增用户并删除
cat /etc/passwd
userdel -r xxx查看是否有残留并删除
find / -name xxx
rm -rf xxx最后更新于
这有帮助吗?