0% found this document useful (0 votes)
25 views

Linux Commands

The document lists several useful Linux/Unix commands for system administration tasks like: 1) Checking file versions, installing scripts, listing partition information, monitoring backups, and checking directory sizes. 2) Commands for monitoring logs, getting CPU and memory information, searching and removing files, and listing the largest files. 3) Ways to remove the most recently updated file, check server uptime, and delete files by month. The document provides examples of commands and their usage for common system administration tasks.

Uploaded by

hsak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Linux Commands

The document lists several useful Linux/Unix commands for system administration tasks like: 1) Checking file versions, installing scripts, listing partition information, monitoring backups, and checking directory sizes. 2) Commands for monitoring logs, getting CPU and memory information, searching and removing files, and listing the largest files. 3) Ways to remove the most recently updated file, check server uptime, and delete files by month. The document provides examples of commands and their usage for common system administration tasks.

Uploaded by

hsak
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Author A.Kishore/Sachin http://appsdba.

info

Some useful Linux/Unix Commands

Check the forms version: strings -a $AU_TOP/forms/US/sachin_test.fmb | grep '$Header' strings -a $SACHIN_TOP/forms/US/sachin_test.fmx | grep '$Header'

Install our own script install -c /usr/local/bin

List the information for partitions [root@erp ~]# parted -l

Monitor backup in RHEL 5 [root@erp ~]# watch df -m

Check the size of a directory [root@erp ~ ]# du -sch .

Monitor rapid clone [root@erp ~]# tail -f file_name_with_location

Check the last updated file name on current location [root@erp ~]# ls -lrt | tail -1 -rwxr-xr-x 1 root dba 41 Feb 22 01:33 new2.sh

Get the CPU info [root@erp ~]# vi /proc/cpuinfo [root@erp ~]# vi /proc/slabinfo

Author A.Kishore/Sachin http://appsdba.info

Remove the last updated file [root@erp ~]# ls -lrt | tail -1| awk {print $9}|xargs rm -f

Check the server up time [root@erp ~]# uptime

Get the Information about memory [root@erp ~]# vmstat [root@erp ~]# vmstat -m Alternatively ,we can check with the following command. [root@erp ~]# iostat -t 10 5

Search and remove files $find . -name file_name | xargs -i rm -rf {}

Top 10 file regarding 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

Delete the files by Month ls -lh | awk {print $6 $9} | sed -n /Mar/p | xargs rm -rf

You might also like