Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Created August 30, 2014 13:37
Show Gist options
  • Save cocoabox/9da2fd018f4dc2ee3a4c to your computer and use it in GitHub Desktop.
Save cocoabox/9da2fd018f4dc2ee3a4c to your computer and use it in GitHub Desktop.
CPU Top5
ps aux | tail -n+2 | sort -rk 3,4 | awk 'NR <= 5 { cpu=$3; pid=$2; $1=$2=$3=$4=$5=$6=$7=$8=$9=$10=""; printf("CPU:%-.1f \tPID:%5d : %s\n", cpu, pid, $0); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment