Linux useful commands

memory

free -m

sar -a 2 2 

ps -eo pid,cmd,%mem,%cpu --sort=-%mem | head

CPU

sar -u 3 3

ps -eo pid,cmd,%mem,%cpu --sort=-%cpu | head

top

process

ps -e --forest | grep sshd

lsof -p pid

disk and files

df -hP

du -h 

ls -i

ls -ltr

state file

fuser filename

lsof filename

network

accounts and permission

system

Last updated

Was this helpful?