Frequently Using Linux Commands

How to check Port availability 

lsof -i tcp:<Port_Num>

Netstat -putan |grep <Port_Number>

netstat -an |grep <Port_Number>

 

lsof -i tcp:8031 

netstat -putan |grep 8031

 

Renaming more than one characters in VI editor

 

Below command is replacing the word "DEV" to TEST in source file

 

perl -pi -e 's/DEV/TEST/g' <File_Name>

 

Ex: perl -pi -e 's/DEV/TEST/g' initTEST.ora  

 

Check the Connection issues

 

nslookup  <Hostname>

tnsping <Hosyname>

 

Searching the Multiple parameters in single file

 

$ORACLE_HOME/OPatche/opatch lsinventory |egrep -w '23456|125679|76578'| grep "applied on"

 

Tar Command


Tar command is using to zip and unzip the files 


Zip files:


tar -cvf 11.2.0.4.tar.gz 11.2.0.4/


Unzip


tar -xvzf 11.2.0.4.tar.gz

 


Nohup command


nohup command in Linux systems that keep processes running even after exiting the shell or terminal.


nohup tar -cvf 11.2.0.4.tar.gz 11.2.0.4/  &


Monitoring nohup process


jobs -l


How to delete huge files

 

Ex:-  Some files consuming more space we need to remove old file use below commands

 

find . -type f -mtime +5

find . -type f -mtime +5 -exec rm -vf {} \;

 

O/P

 

removed ‘./l1104704913.req’

removed ‘./l1104701655.req’

removed ‘./l1104705584.req’

 

How to move old file to other folders

 

Mtime +4 means after 4 days files only move to below mentioned folders

 

find . -type f -mtime +4

 

find . -type f -mtime +4 -exec mv {} /sanjeev/ebs/XDO_BKP/ \;

 

Find Top consuming space files

 

[applmgr@ebsvis log]$ du -sh *|sort -rh | head -n 5

133G    l6805177.req

104G    l6805159.req

37G     l6802151.req

36G     l6805766.req

35G     l6806182.req

  

Comments

Popular posts from this blog

How to troubleshoot long running concurrent request in R12.2

How to run Gather Schema Statistics in R12.2

How to compile forms in R12.2