Monday, January 31, 2022

How to search for a text from files in a directory on Linux

 find -type f -name "*.xml" -exec grep -l 'searchtext' {} +


Use the above command to find all files (in this case xnl) containing specific text 'searchtext' on Linux


Unix commands to get the count of files

 ls -l *.rdf | wc -l