「CentOS7入門」ps、killコマンドで実行中のプロセスを操作する
1.実行中のプロセスを表示
# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 190840 2544 ? Ss 2017 14:59 /usr/lib/system
root 2 0.0 0.0 0 0 ? S 2017 0:04 [kthreadd]
root 3 0.0 0.0 0 0 ? S 2017 1:20 [ksoftirqd/0]
root 7 0.0 0.0 0 0 ? S 2017 0:03 [migration/0]
root 8 0.0 0.0 0 0 ? S 2017 0:00 [rcu_bh]
root 9 0.0 0.0 0 0 ? S 2017 67:26 [rcu_sched]
root 10 0.0 0.0 0 0 ? S 2017 3:01 [watchdog/0]
root 11 0.0 0.0 0 0 ? S 2017 2:20 [watchdog/1]
root 12 0.0 0.0 0 0 ? S 2017 0:04 [migration/1]
root 13 0.0 0.0 0 0 ? S 2017 0:10 [ksoftirqd/1]
root 16 0.0 0.0 0 0 ? S 2017 2:24 [watchdog/2]
中略
2.grepコマンド
# ps aux | grep nginx
nginx 1719 0.0 2.7 635784 57172 ? S Mar27 22:56 php-fpm: pool www
nginx 2866 0.0 2.7 635404 57096 ? S Mar25 24:01 php-fpm: pool www
nginx 3012 0.0 3.3 636708 69384 ? S Mar06 35:13 php-fpm: pool www
nginx 3298 0.0 2.9 636320 59460 ? S Mar13 30:39 php-fpm: pool www
3.プロセスの強制終了
#kill 30870