Notice: Undefined index: searchOption in /home/vivekvermani/public_html/UnixCommand/searchUnixCommandsScripts.php on line 140
Unix Commands/Scripts for '#Find files'
Share

Search Unix Commands/Scripts


  Help us in improving the repository. Add new commands/scripts through 'Submit Commands/Scripts ' link.





Unix Commands/Scripts for '#Find files' - 5 Commands/Scripts found

 Sample 1. Finding any of the multiple texts strings in file

egrep 'Error|Exception|Debug' logfile.txt

   Like      Feedback     egrep   grep log  grep


 Sample 2. Finding text within .gz (zipped) file without unzipping them

zgrep -i Error *.gz

   Like      Feedback     grep  zgrep  zgrep -i  grep within zipped file


 Sample 3. Report the file size of all files bigger than 2 mb and older than 30 days

find . -type f -size +4096 -atime +30 -exec du -sk '{}' ;

   Like      Feedback     find   du   -exec  find files


 Sample 4. Get all Errors in a log file for last n days in a seperate error file

find /LogFilesfolder/ -iname "SystemOut*" -mtime -7 -exec zgrep "| ERROR |" {} ; >> logReport.txt

   Like      Feedback     find  -iname  -mtime  zgrep  find errors in log file


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
 Sample 5. Find text within files of a directory recursively

grep -R "<text>"

   Like      Feedback     



Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus