Skip to main content

/docs/images/banner.jpg

Operating System

Shellscript

Commands

get current OS version

echo "Current OS version"
echo "OS version"
uname -a

ten processes in descending order

echo "Top 10 processes"
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head

highest memory consuming process

echo "Highest memory usage"
ps aux | sort -nk +4 | tail

curent user

echo "Current user and logname"
whoami
id -nu

path

echo "Current shell"
echo $SHELL
echo "Current Home directory"
echo $HOME
echo "Current Path"
echo $PATH
echo "Current working directory"
pwd

refer to Shell Scripting for theory