Tuesday, 21 June 2011

Some Useful Command

du -h / | grep ^[0-9.]*G   --------->That will give you a list of directories which size is more than 1Gb so that we can try to filter out what's happening.

cat /proc/meminfo | grep MemTotal | cut -d : -f2     ----> show total amount of ram in the system
cat /proc/meminfo | awk '/MemTotal/ {print $2}'   ------> same as above

cd /var/spool/clientmqueue    ----> look in this directory also for unwanted queue

find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'  ----> command to find large size files

du -xak .|sort -n|tail -50--->it lists the 50 biggest files or directories sorted by size

ls -lhR | grep 'G '--->Not perfect but let me know the big files more than 1 GB

du -h | grep [0-9]G --->This will list all files that are in GB.

egrep 'M[^ ]*$' <filename>------>M is the word to be found

#awk 'NR==2{print $0}' filename

This will display 2nd line of file named filename.

And the normal Issues like Httpd being override

ps afx | grep httpd | gawk '{ print " kill -9 " $1 }'      -----> use this command

service httpd restart

No comments:

Post a Comment

Twitter Bird Gadget