|
I'm not seeing an option on grep for fullpath in qsh so I came up with this: find /home/t2web/includes/##usr -exec grep -l 'abcdef' {} ';'Leave off the trailing / on your starting path of you'll get /home/t2web/includes/##usr//foo/bar/file.txt
YMMV, there may be a more elegant way to do it. Thanks, Alfred Alfredo Delgado wrote:
You can pass a recursive switch like: grep -r 'abcdef' /home/t2web/includes/##usr/*However, if you just want the filenames you can use: grep -lr 'abcdef' /home/t2web/includes/##usr/*Thanks, Alfred Mark Allen wrote:I have a need to search a directory for any files containing a specific string (example below) grep 'abcdef' /home/t2web/includes/##usr/*.* This works fine EXCEPT it doesn't search any of the subdirectories (and then any subdirs under those subdirs, etc.----> DON"T ASK WHY) Newbie at this and quick search did not show (or at least I didn't see it) but is there a switch or another parm that I could add so that it would do the subdirs...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.