Saturday, 31 January 2015

Useful commands Linux/Unix Flavor

Useful commands Linux/Unix Flavor

Top :

$TOP     This will display the top 10 process for eg: CPU & Memory Consumpton
$iostat:
$iostat -t 10 5
This command will provide the information about the disk utilization, Read/Write rate, etc..
$vmstat:
$vmstat -m
This command provide the swap memory utilization report.
$sar System Activity Reporter:
This tool can provide the report about CPU Load, iowait and other useful info at specified intervals.
dmesg:
This command display all the server errors including Hardware, booting, network errors
This command will retrieve the information from log files which located in /var/log
Other Useful commands to collect some info about the server :
runlevel – To Know the Current Run Level
netstat –a – To see the Network sessions
netstat –rn – To View the gateways configured
who / finger – To View the Users logged in detail
ps –ef – To view all the running process and its related files
sestatus – To check SELINUX status
service iptables status – To check firewall status
ifconfig –a – To View the Network cards and IP Address configured
uptime :
This command provide the server up time.
This below commands provide CPU information.
vi /proc/cpuinfo
vi /proc/slabinfo
cat /proc/cpuinfo (CPU)
cat /proc/meminfo (Memory)
cat /proc/cpuinfo   --- To check the number of processers on the server
cat /proc/meminfo --- To check the memory info on the servers (for eg: ram size)
du -sch ---  To check  the size of a directory.