********************************************************************
Run the following command to check if port is in use
# netstat -an | grep <port number>
If above returns the connection, then run the following command to get the address of the port number
# netstat -Aan | grep <port number>
Once you have the address of the port number, run the following command to get the process id that is using the port.
# rmsock <address of port number> tcpcb
Example
# netstat -an | grep 30767 tcp4 0 0 *.30767 *.* LISTEN # netstat -Aan | grep 30767 f100060001b2f398 tcp4 0 0 *.30767 *.* LISTEN # rmsock f100060001b2f398 tcpcb The socket 0x1b2f008 is being held by proccess 942150 (vcs_agent).
$ find <where> <condition> <action>
FInd The Largest Files in a Directory
*************************************************
find /web( path mentioned ) -xdev -type f -ls |awk ‘{print $7″ “$8” “$9” “$10” “$11}’|sort -rn |head -20
du -a . | sort -nr | head
*******************************************************
Working with Crontab
********************************************************
—->crontab -l —- list all the cron jobs
—->crontab -e —- to edit the cronjobs
—->crontab -r —– to remove the crons(before removing it create a backup)
—->crontab -l > filename.txt
—->crontab -e filename.txt
—->crontab filename.txt.
Recent Comments