Unix Commands/Scripts for '#Find' - 9 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 relevant word and excluding irrelevant word | |
|
grep xception logfile.txt | grep -v ERROR
|
|
Like Feedback grep grep log grep -v |
|
|
Sample 3. Finding text within .gz (zipped) file without unzipping them | |
|
zgrep -i Error *.gz
|
|
Like Feedback grep zgrep zgrep -i grep within zipped file |
|
|
Sample 4. find occurences of a particular error in last n days | |
|
find /opt/WebSphere/AppServer/profiles/application/logs/ -iname "SystemOut*" -mtime -7 -exec zgrep "FileNotFoundException" {} ; >> logAnalysis.txt
|
|
Like Feedback find zgrep -iname 0mtime >> |
|
|
|
Sample 5. 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 |
|
|
Sample 6. 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 7. Find text within files of a directory recursively | |
|
grep -R "<text>"
|
|
Like Feedback |
|
|
Sample 8. How to find lines in a file "File" containing "some text" ? | |
|
grep "some Text" File
|
|
Like Feedback |
|
|
Sample 9. Could not find module "@angular-devkit/build-angular" from | |
|
npm install --save-dev @angular-devkit/build-angular
|
|
Like Feedback |
|
|