Monday, November 29, 2010

Other Monitoring Commands..

getting the forms version:

strings -a $AU_TOP/forms/US/JAINOTAX.fmb | grep '$Header'
strings -a $JA_TOP/forms/US/JAINOTAX.fmx | grep '$Header'


to install own script
install -c /usr/local/bin

gathering information for partitions
[root@rac-1 code]# parted -l

To monitoring backup in RHEL 5
watch df -m

checking the size of a directory
[root@rac-1 code]# du -sch .


monitoring rapid clone 
tail -f file_name_with_location

Getting the last updated file name on current location 
[root@rac-1 code]# ls -lrt | tail -1
-rwxr-xr-x 1 root dba 41 Aug 22 01:33 new2.sh

Gathering CPU info 
[root@rac-1 code]# vi /proc/cpuinfo
[root@rac-1 code]# vi /proc/slabinfo

Removing last updated file 
[root@rac-1 code]# ls -lrt | tail -1| awk ‘{print $9}’|xargs rm -f

Investigating the servers life time 
[root@rac-1 code]# uptime

Information about memory
[root@rac-1 code]# vmstat
[root@rac-1 code]# vmstat -m


Alternatively 
[root@rac-1 code]# iostat -t 10 5

Searching and removing files 
$find . -name file_name | xargs -i rm -rf {}

Stat
[root@rac-1 code]# stat progress-ber2.sh

Top 10 file w.r.t there size: 
find . -type f | xargs ls -s | sort -rn | awk ‘{size=$1/1024; printf(“%dMb %s\n”, size,$2);}’ | head
or
du -xak . | sort -n | awk ‘{size=$1/1024; path=”"; for (i=2; i 50) { printf(“%dMb %s\n”, size,path); } }’
or
du -a /var | sort -n -r | head -n 10


Deletion by Month 
ls -lh | awk ‘{print $6 ” ” $9}’ | sed -n ‘/Mar/p’ | xargs rm -rf



Regards,
Sukhwinder Singh




 
 
 











No comments:

Post a Comment

Note: Only a member of this blog may post a comment.