How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
-r
is for recursive;-e
is optional but its argument specifies the regex to search for. Interestingly, POSIXgrep
is not required to support-r
(or-R
), butI'm practically certain that System Vin practice they (almost) all do. Some versions ofgrep
did, sogrep
support-R
as well as (or conceivably instead of)-r
; AFAICT, it means the same thing.If your grep supports
-R
, do:If not, then use
find
: