Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Find a text inside the files contained in a folder

$
0
0
Many times there will be a situation where we know the contents of the file but we don't have the details of the file name and its location.

In this case, just go to the parent folder and issue the below command.
You will get the details.

find . -type f -name "*.sh" -exec grep -il {} \;

Example:

find . -type f -name "*.sh" -exec grep -il JAVA_HOME {} \;

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>