I need to list files from a directory which contains a specific string using linux commands.
Use the command
grep -inr <string> /path/to/directory
The -inr option has three parts:
i to ignore case sensitivity,n to display the line numbers in for each matched result, andr to recursively read all files under each directory.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With