Skip to content

Instantly share code, notes, and snippets.

@teddyking
Last active August 24, 2017 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teddyking/b03ef88f454ad31a1527da1e81930f12 to your computer and use it in GitHub Desktop.
Save teddyking/b03ef88f454ad31a1527da1e81930f12 to your computer and use it in GitHub Desktop.
A collection of commands that are useful when debugging linux systems
# list processes in D or Z state, along with kernel function where the processes are sleeping
ps axo pid,ppid,comm,state,eip,esp,wchan | grep 'D\|Z'
# dump all D state processes incl. kernel stack traces to /var/log/messages
echo w > /proc/sysrq-trigger
# check process start time
ps -eo pid,comm,lstart,etime,time,args
# view syslog without noise
cat /var/log/syslog | grep -Ev 'audit|Lease|CMD|CRON|DHCP|dhclient|anacron' | less
# see how much memory a process is using
grep VmRSS /proc/PID/status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment