Saturday, July 23, 2011

LINUX and UNIX COMMANDS

USEFUL COMMANDS



1. List files and folders in a directory :  ls

2. Print all the lines which contain the string in a given file :

sed -n '/51b913efb24e9d23:-60c12f92:147262690f0:-8000-0000000000348782/p' soa_server2-diagnostic-432.log >  soa.log


3. Run weblogic in backend :

     nohup ./startWeblogic.sh &

3. Ram size

a. In MB : free -m

b. How much RAM is used :

free | awk '/Mem/{printf("used: %.2f%"), $3/$2*100} /buffers\/cache/{printf(", buffers: %.2f%"), $4/($3+$4)*100} /Swap/{printf(", swap: %.2f%"), $3/$2*100}'


4. Find folder from root, excluding permission denied errror

find / -name "integration" -type d 2>/dev/null

5. To compress separate files : zip squash.zip file1 file2 file3
6. To compress directory to zip : zip -r <squash.zip> <dir1>
7. To uncompress : unzip squash.zip

8. Size of current folder and subfolders : du -sh , du , du -h


No comments:

Post a Comment