一. 命令积累
1. 查看进程
$ top
2. 查看进程树
$ pstree
-a 显示每个进程的完整指令,包括路径、参数
-h 高亮显示正在执行的程序
-u 显示用户
3. kill命令
1>.杀死进程
$ kill 12345
2>.强制杀死进程
$ kill -KILL 123456
3>. 彻底杀死进程
$ kill -9 123456
4. 查找文件
第一部分 - 查找名称查找文件的基本查找命令
1>.在当前工作目录中查找名称为test.c的所有文件
$ find test.c
2>.查找/ home目录下的所有文件,名称为test
$ find /home -name test
3>.找到名称为test的所有文件,并在/home目录中同时包含大写和小写字母
$ find /home -iname test
4>.在/目录中查找名称为test的所有目录。
$ find / -type d -name test
5>.在当前工作目录中查找名为test.PHP的所有PHP文件
$ find -type f -name test.php
6>.查找目录中的所有php文件
$ find -type f -name "*.php"
第二部分 - 根据他们的权限查找文件
1>. 找到一个名为test.c的文件并将其删除
$ find -type f -name "test.c" -exec rm -f {} \
2>. 查找和删除多个文件,如.mp3或.txt,然后使用
$ find -type f -name "*.txt" -exec rm -f {} \
$ find -type f -name "*.mp3" -exec rm -f {} \
3>.要查找所有隐藏的文件,请使用以下命令
$ find /tmp -type f -name ".*"
参考链接: https://cloud.tencent.com/developer/article/1348438
5. 查看定时程序
$ crontab -l #查看当前用户下可疑定时任务
$ crontab -e #删除可疑定时任务
6. 查询守护进程
$ systemctl status sshd ##查看指定服务的状态
$ systemctl stop sshd ##关闭指定服务
$ systemctl start sshd ##开启指定服务
$ systemctl restart sshd ##从新启动服务
参考链接: https://blog.csdn.net/sky__man/article/details/78178821
https://blog.csdn.net/skh2015java/article/details/94012643
7.查看PID及其对应的输出地址:
netstat -natp