Skip to content

Instantly share code, notes, and snippets.

@afro-coder
Last active March 15, 2022 18:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Daily Linux trouble shooting commands

Get a list of running processes

ps aux

Filter through the processes replace "<keyword>"

ps aux| grep <keyword>

Search for 2 or more processes

ps aux| egrep '<keyword1>|<keyword2>|<keyword3>'

Show running processes using top

top -c

Or use htop

To check if a port is occupied, and by which process

lsof -i :80
or
ss -patun| grep -w 80

Read about SAR for understanding cpu avg over time etc. Install atop to monitor historic events

To check disk usage Overall disk usage

df -Th

Top 10 files

du -ach --max-depth=1 / | sort -rh | head -n10

Change password

passwd username

Reset MySQL root password https://linuxize.com/post/how-to-reset-a-mysql-root-password/

Reboot a server

reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment