diff --git "a/20\346\234\261\347\216\211\346\225\217/20240619-\350\277\233\347\250\213\347\256\241\347\220\206.md" "b/20\346\234\261\347\216\211\346\225\217/20240619-\350\277\233\347\250\213\347\256\241\347\220\206.md" new file mode 100644 index 0000000000000000000000000000000000000000..abbbca71832d49afcb98621bf3fabcd6a5fa8b30 --- /dev/null +++ "b/20\346\234\261\347\216\211\346\225\217/20240619-\350\277\233\347\250\213\347\256\241\347\220\206.md" @@ -0,0 +1,35 @@ +进程管理 + +1. systemctl和service + + - 启动服务 : systemctl start 服务名 service 服务名 start + + - 停止服务 : systemctl stop 服务名 service 服务名 stop + + - 重启服务 : systemctl restart 服务名 service 服务名 restart + + - 查看服务 : systemctl status 服务名 service 服务名 status + + - 重新加载配置文件 : systemctl reload 服务名 + +2. ps 列出当前正在运行的进程 + + ``` + ps -aux:显示所有用户的所有进程 + ps -ef :以完整格式显示所有进程 ( |grep 关键字) + ``` + +3. kill 终止指定进程 + + ``` + kill 进程号 + kill -9 pid(进程号) 强制终止进程 + + pstree(以树结构显示进程,要下载安装包psmisc) + ``` + +4. bg 将进程放到后台执行 + + fg 将进程放到前台执行 + +5. top 实时监控进程 \ No newline at end of file