To search particular word
----------------------------------
find . -print|xargs grep -i "ARXTWMAI"
To find files as per size, age
--------------------------------------------------------
find . -type f -mtime +2 -name '*.*' -print
find . -name '*.*' -size +15000k -mtime +20 -print
find . -name '*.*' -mtime +20 -print | args ls
To move/delete files as per age, size
-------------------------------------------
#by age
find . -type f -mtime +1 -name '*mmon*' -print |xargs rm –rf
nohup find . -mtime +x -type f -exec mv {} /psgdsi/applcsf/out_old \; &
find /racp02/u01/app/oracle/eb01qdb/10.2.0RAC/admin/eb01q1_usmliu61/bdump -name 'cdmp*' -mmin +120 -exec rm -fr {}
find . -mmin +5 -mmin -10 # find files modified between6 and 9 minutes ago
#by size
find . -name '*.*' -size +50000k -print | xargs rm –rf
# age and size
find . -name '*.*' -size +5000k -mtime +30 –print
find . -name '*.*' -size +500k
Identify process & kill
-----------------------
top cpu time consuming processes
ps -ef|sort +6|tail
Count all process connected to oracle db(excluding background ones)
-----------------------------------------------------------------
ps -ef|grep ecstest |grep -v grep|grep ora_| wc -l
to kill all oracle instances background processes
--------------------------------------------------
ps -ef|grep "java"|grep -v grep|awk '{print $2}'|xargs -i kill -9 {}
kill processes of single user
----------------------------
pkill -u username
pkill -u asceb05
to kill all processes of a particular user
-------------------------------------------
ps -ef | grep apdchpgi | grep -v grep | grep -v ksh | grep -v UID | grep -v bash | grep -v fu | grep -v xterm | awk '{print $2}' | xargs kill –9
Tar commands
--------------------------
go in appltop and give
nohup tar -cvf - * | gzip > /rh89/u02/app/aibmut1/aibmut1appl.tar.gz &
tar and gzip at same time
==========================
go in appltop and give
nohup tar -cvf - * | gzip > /rh89/u02/app/aibmut1/aibmut1appl.tar.gz &
:1,$ s/ecsqual1/ecsqual3
to replace ecsqual1 by ecsqual3
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment