I have a directory with about 20 folders and many different types of files. I need to search for files and gzip in all the directories except for 1 directory.
How do you exclude a directory?
I have a directory with about 20 folders and many different types of files. I need to search for files and gzip in all the directories except for 1 directory.
How do you exclude a directory?
I am not sure whether there is any option in 'find' command to get this done. A work around would be to pipe the output of find with 'grep -v'.
find . -name "*.gzip" | xargs grep -v TEST (where TEST is the directory to be excluded)
try the -prune option as in
find . -wholename './src/emacs' -prune -o -print