Link to home
Start Free TrialLog in
Avatar of Anthony Lucia
Anthony Lucia

asked on

Linux: How to find string in a file within subdirectories

What command do I use to find a string within a file that is possibly contained within a subdirectory

The string I want to find is 8585

Thanks
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
grep is your friend...

grep - r "8585"

more on grep
Avatar of madunix
madunix

find ./ -type f -exec sed -i -e 's/old/new/g' {} \;
it goes  through sub directories.
@madunix: Anthony Lucia asked for a way to find the string, not to find and replace it with some other string.