UNIX - Useful Linux commands

General Commands

whatis Brief descriptino of file
stringsFinds human readable strings
whereis cat
Shows directory for command
find /var/log/ -name local\* -mtime +2 -exec rm {} \;
Removes files named local* but last 3 days
unset TMOUT TIMEOUTRemove terminal timeouts
type/whichFind path of program
cut -d: -f1
use a : delimter and display field 1
find / -name "*tgz" -exec ls -l {} \;
list tgz's

bc -l

binary calculator
base64
encode /decode images

Networking Commands

netstat -s                              Shows networking stats
eth-tool
Networking Tool
mii-toolNetworking Tool
/proc/net/ip_conntrack 
/proc/net/sockstat
Shows Sockets in us
/proc/net/dev
networking stats

User Commands

last                                             
 who logged in last
who
 whos logged in
fuser -va 22/tcpWhich user is using TCP 22
fuser -va /var
Which user is using /var

System Resources

ps -auxw | sort -k3 -r | head -n10show processes by cpu usage
lshw -C disk -html > /tmp/diskinfo.htmloutput disk info to html
cat /proc/meminfo Shows memory stats
ps -e | awk '{ print $4 }' |  sort | uniq -c | sort -nr | headShows process totals
du -skh *Diskpace usage
nice -n 10 catMake priority weaker
nice -n -10 catMake priority higher
vmstat 5 5 
Checks CPU every 5 secs , 5 times

Disto Specfic

chkconfig --list                                                                 
Redhat - Show Run levels
chkconfig ssh onRedhat - Adds program to run levels

 

Article updates via email..


We have 25 guests online