I have directory structure like this
data
|___
|
abc
|____incoming
def
|____incoming
|____processed
123
|___incoming
456
|___incoming
|___processed
There is an incoming sub-folder in all of the folders inside Data directory. I want to get all files from all the folders and sub-folders except the def/incoming and 456/incoming dirs.
I tried out with following command
find /home/feeds/data -type d \( -name 'def/incoming' -o -name '456/incoming' -o -name arkona \) -prune -o -name '*.*' -print
but it is not working as expected.
Ravi
This works:
Explanation:
find /home/feeds/data: start finding recursively from specified path-type f: find files only-not -path "*def/incoming*": don’t include anything withdef/incomingas part of its path-not -path "*456/incoming*": don’t include anything with456/incomingas part of its path