top - Hot Keys
Press Shift + P - sort processes in top by high CPU usage
Press Shift + M - sort processes in top by high Memory usage
Press k - kill process, need enter
Press f - Fields Management for window:
- 🛈 Right selects for move then <Enter> or Left commits
- 🛈 'd' or <Space> toggles display
- 🛈 's' sets sort (for selected by “Right Arrow” column “SWAP“ )
- 🛈 Use 'q' or <Esc> to end!
Top 10 processes in the swap
for file in /proc/*/status ; do awk '/Tgid|VmSwap|Name/{printf $2 "\t" $3}END{ print ""}' $file; done | grep kB | sort -k 3 -nr | head -10
How to Check Swap and Memory Usage Live via the 'top' Command on Oracle Linux 5, 6, 7, and 8. (Doc ID 2422888.1)
Run top --> press f select SWAP --> press Space --> s --> Esc