cheat sheet for top
1 top
Is used on every unix/linux system I have ever come across. There are colour versions such as htop available, but these have to added and installed into the system, and so take up more resources. Here is a list of commands used by plain Jane vanilla top
- d delay (default 3 seconds) before refreshing output
- z colour screen red (toggle)
- c toggle absolute path of running process
- q quit
- O sorting (but how?)
- a PID
- b PPID
- d UID
- e USER
- r GROUP
- g TTY
- K CPU% CPU usage
- l TIME CPU time
- m TIME+ CPU time hundredths
- n MEM% Memory usage
- o VIRT virtual image (kb)
- p SWAP swap space (kb)
- q RESident size (kb)
- r CODE size
- s DATA stack size (kb)
- t shared mem size (kb)
- u Page fault count
- v Dirty pages count
- w process status
- x command name/line
- y sleeping function
- z Task flags
- k kill process
- u top for a specific user's process top -u zintis
- P sort by running processes CPU utilization
- r renice a process *have to know all the process priority levels
- h help
- top -n 10 (will exit after 10 intervals.)
2 Save top resuls into a file:
top -n 1 -b > top-output.txt # this may get fairly long soon