Linux top Recipe

  1. Run top in the background with a 30 second interval:
    nohup sh -c "top -c -w 512 -b -d 30 | grep --line-buffered -A 10 '^top - ' >> diag_top_$(hostname)_$(date +%Y%m%d_%H%M%S).txt" &>> diag_nohup.out &
  2. Reproduce the problem.
  3. After the problem is reproduced, stop collection by killing the top process. For example:
    pkill -TERM -f "top -c -w 512"
  4. Upload diag_*