Unix Tips

How to search for  a string in entire directory?
We can used this easy command 
#grep -ir 'string' /directory name
<filename>:string   ---output will be of this format
Where does the installation log for RHEL reside?
It will be in the /root/anaconda-ks.cfg. It contains the configuration information like packages,volumes etc. also install.log in the same directory.


When you are not able to open the JDE in solaris
First check the diskspace. Check the IP address,hostname settings


How to find the size of the files in the directory and sort them
#du -h --max-depth=2 /opt/ | sort -n -r 
depth will the level of hierarchy that you want to check the size
depth =1 /opt/
depth =2 /opt/  , /opt/oracle
depth=3 /opt/, /opt/oracle, /opt/oracle/product


How to extend the LV ?
Ans) # lvextend -L+1G /dev/myvg/homevol
   # resize2fs /dev/myvg/homevol

How to find the location from which the process is started?
Ans) #ps -ef | grep <process-name>
       #pwdx <pid> will give the location from which the process (script) was started (executed)