Using Find – Linux

Find specif name of files then look for a specific words inside

#find . -name *.xml -exec egrep -i -H -l –color ‘Server\ Farm\ 3’ ‘{}’ \; -print | uniq |  xargs  -exec egrep -H –color  ‘MachineName|ResourceName|BackupSetName|

BackupTimeUTC|NumBytes|CartridgeLabel|ExpirationTimeUTC|BackupType|ExtStatus’ ‘{}’ \;  > c:\/backuplogs\/ServerFarm3.xml

 

find . -name *.xml -exec egrep -i -H -l –color ‘CDSRV01’ ‘{}’ \; -print  |

xargs  -exec egrep -H –color  ‘MachineName|ResourceName|BackupSetName|CreationTimeUTC|

DataSize|CartridgeLabel|ExpirationTimeUTC|BackupType’ ‘{}’ \;

 

find -name {93DFD1BC-E228-46AF-8B83-5F70A9ED0896}_182.xml -exec egrep -i –color ‘BackupSetName|[ResourceName,CDSRV01]’ ‘{}’ \;

 

find . -exec grep “CDSRV01” ‘{}’ \; -print

find . -name “*.png.gz” -exec gunzip {} \;

find files with size more than 1 GB

 find /home -type f  -size +10000k -exec ls -lh {} \; | awk ‘{print $5 “: ” $NF}’

Leave a Reply

Your email address will not be published. Required fields are marked *

4 + 1 =