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
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
Tags:
Linux