Answer the question
In order to leave comments, you need to log in
How to find the desired file via linux terminal knowing the file contains a word?
You need to find the file.
There are many folders. One of them contains a file. The file contains a word.
There are many files, there are tar archives, there are gz archives. There is a nesting doll - one in the other - an archive in an archive.
How to find the desired file via linux terminal knowing the file contains a word?
Answer the question
In order to leave comments, you need to log in
I'm afraid it will be necessary to write a script that will unpack the archives. Alas, but without it, not how.
Everything else is solved by grep, egrep, awk or find.
grep -lir 'text' /home/%username%/doc
for thought
find . -type f -exec grep -l "content" {} \;
-l - Displays the name of the file in which the content was found.
accordingly, you will need to unpack files on the fly and run find inside
Well, yes, most likely you will need to change something
Find all php.ini files and replace the directive in them
find . -name 'php.ini' -exec sed -i 's/log_errors = Off/log_errors = On/g' "{}" \;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question