- To check processes by a user
top -u <username>
- To check for process(es)
top -p <pid1>,<pid2>
- To cycle through Kb/Mb/Gb ...
- Capital E - for system level info
- Small e - for process level info
- To check mem usage by code and data
- Small f - and then space to add or remove a column
- By default this shows the process id (pid) of a process
- hitting "H" also shows the threads
- hitting "U" and then typing your username allows to see only your users pids (in a cluster scenario)
- To see which processor a pid is running on
watch -n 0.1 'ps -o pid,psr,comm -p <pid>'
(dunno whats it practical use case)
- To count the thread a process has spawned
ps -o thcount <pid>
(thcount=thread count)ps -o nlwp <pid>
(nlwp=number of light weight processes)cat /proc/<pid>/status| grep Threads
- Getting memory (in MB)
ps -o rss -p <pid> | awk 'NR>1 {$0=($0/1024);}{print;}'