#processes
9 one-liners with this tag.
All one-liners tagged processes
Count PHP-FPM processes per pool
$ps -eo args | grep '[p]hp-fpm: pool' | awk '{print $NF}' | sort | uniq -c | sort -rn
Count running Apache processes
$ps -C apache2 --no-headers | wc -l
Find deleted files still held open
#lsof -nP +L1
Find processes whose executable was deleted
#ls -l /proc/*/exe 2>/dev/null | grep '(deleted)'
Kill a hanging MySQL query
#mysql -e 'KILL 12345;'
Show currently running cron jobs
$ps -eo pid,user,etime,cmd --forest | grep -A3 '[C]RON'
Show running lsphp processes with memory usage
$ps -eo pid,user,%cpu,rss,etime,cmd --sort=-rss | grep -E "[l]sphp"
Show running MySQL queries without idle connections
#mysql -e "SELECT id, user, db, time, state, LEFT(info, 100) AS query FROM information_schema.processlist WHERE command <> 'Sleep' ORDER BY time DESC;"
Show the processes running in a Docker container
#docker top app