How to exclude a particular directory from being searched while using grep function
How to exclude a particular directory from being searched while using grep function,like for example I want to grep for a pattern "abc" in a directory called main but I don't want to search for "abc" in one of the sub directories,say sub of main.So how to exclude sub from being grepped?
|
have you tried consulting "man grep"
it has this options: --exclude, and --exclude-dir Like: grep -r "Search_this_dir" /path/to/be/search --exclude-dir="do_not_include_this_dir" BTW, Welcome to LQ!! Cheers..happy learning. :) |
All times are GMT -5. The time now is 04:54 AM. |