Linux useful commands

Linux useful commands


# -Hostname.

echo -e "\e[35;42m***** HOSTNAME  *****\e[0m"
hostname

# -File system disk space usage:

echo -e "\e[35;42m***** FILE SYSTEM DISK SPACE USAGE *****\e[0m"
df -h

# -Free and used memory in the system:

echo -e "\e[35;42m ***** FREE AND USED MEMORY *****\e[0m"
free

# -Server uptime and load:

echo -e "\e[35;42m***** SERVER UPTIME AND LOAD *****\e[0m"
uptime

# -Logged-in users:

echo -e "\e[35;42m***** CURRENTLY LOGGED USERS *****\e[0m"
who

# -Top 5 processes as far as memory usage is concerned

echo -e "\e[31;43m***** TOP 10 MEMORY-CONSUMING PROCESSES *****\e[0m"

ps -eo %mem,%cpu,comm --sort=-%mem | head -n 11

Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post