I can't seem to get find to use both -prune and -size together. I want to find files over a certain size and at the same time exclude certain directories.
I'm able to do one or the other but not both simultaneously.
To find files of a certain size I use this in a bash script.
Code:
find $1 -user $USER -type f -size +600k -exec ls -lh {} \;
To exclude certain paths in the find I use this.
Code:
find $1 -user $USER -type f -size +100k -path $1/.snapshot -prune -o -print -exec ls -lh {} \;
The second statement excludes the .snapshot directory but I'm getting all file sizes returned and not just the ones over 100k. It also appears that the -user flag is ignored.
What am I doing wrong?