↑ ↓ select, Enter open, Esc close

Processes

What is eating CPU and RAM? Find, stop and prioritize processes and find out which service is listening on which port.

16 one-liners: 13 harmless, 3 caution, 0 destructive

All Processes one-liners

Compare load average with the number of CPU cores

$uptime && nproc
harmless

Count processes per user

$ps -eo user= | sort | uniq -c | sort -rn
harmless

Find out which process is using a port

#ss -tlnp 'sport = :80'
harmless

Find out which processes are using swap

$for f in /proc/[0-9]*/status; do awk '/^Name:/ {n=$2} /^VmSwap:/ {print $2, "kB", n}' "$f"; done 2>/dev/null | sort -rn | head -15
harmless

Find processes killed by the OOM killer

#journalctl -k --no-pager | grep -iE "out of memory|oom-kill|killed process"
harmless

Find zombie processes and their parent processes

$ps -eo pid,ppid,stat,cmd | awk 'NR == 1 || $3 ~ /^Z/'
harmless

More power on the server

Does the optimization reach your visitors?

Faster database, more RAM, better caching: GENLOC.SEO measures whether it shows up in PageSpeed and Core Web Vitals. Free, for mobile and desktop.

by GENLOC.NETWORK, the team behind myline.de

Kill all processes matching a name

#pgrep -af "wp-cron.php" && pkill -f "wp-cron.php"
caution

Lower the priority of a running process

#renice -n 19 -p 1234 && ionice -c 3 -p 1234
caution

Run a command with low CPU and IO priority

$nice -n 19 ionice -c 3 du -sh /var/www/vhosts
harmless

Show open files of a process

#lsof -p 1234
harmless

Show processes as a tree with parents and children

$ps -ef --forest
harmless

Show processes with the highest CPU usage

$ps aux --sort=-%cpu | head -15
harmless

Show processes with the highest RAM usage

$ps -eo pid,user,%mem,rss,cmd --sort=-rss | head -15
harmless

Show start time and runtime of a process

$ps -o pid,user,lstart,etime,cmd -p 1234
harmless

Sum up RAM usage per program

$ps -eo rss=,comm= | awk '{a[$2]+=$1} END {for (p in a) printf "%8.1f MB %s\n", a[p]/1024, p}' | sort -rn | head -15
harmless

Terminate a process and force kill only if needed

#kill 1234; sleep 5; kill -0 1234 2>/dev/null && kill -9 1234
caution

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.