Searching whole system using:
find / -type f -size +100M -exec ls -lh {} \; | awk '{ print $9 "|| Size : " $5 }'
How can I omit a directory? I see -prune -o, but I am not sure how to format the option.
Searching whole system using:
find / -type f -size +100M -exec ls -lh {} \; | awk '{ print $9 "|| Size : " $5 }'
How can I omit a directory? I see -prune -o, but I am not sure how to format the option.
find / -path /path/to/ommit -prune -o -type f -size +100M -exec ...
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From man
:
To ignore a whole directory tree, use -prune rather than checking every file in the tree. For example, to skip the directory
src/emacs
and all files and directories under it, and print the names of the other files found, do something like this:find . -path ./src/emacs -prune -o -print
Note that the pattern match test applies to the whole file name, starting from one of the start points named on the command line.