I think it's because it still needs to test everything it finds against the path pattern - if you want to ignore a whole directory branch completely, use -prune instead e.g.
Code:
$ find ~/ ! -path "/home/steeldriver/.cache/*" -mtime -1 -print
/home/steeldriver/
/home/steeldriver/.cache
find: ‘/home/steeldriver/.cache/dconf’: Permission denied
/home/steeldriver/.Xauthority
/home/steeldriver/somefile
/home/steeldriver/.config/dconf
/home/steeldriver/.config/dconf/user
/home/steeldriver/.local/share/zeitgeist/activity.sqlite-shm
/home/steeldriver/.local/share/zeitgeist/activity.sqlite-wal
/home/steeldriver/.lesshst
whereas
Code:
$ find ~/ -path "/home/steeldriver/.cache" -prune -o -mtime -1 -print
/home/steeldriver/
/home/steeldriver/.Xauthority
/home/steeldriver/somefile
/home/steeldriver/.config/dconf
/home/steeldriver/.config/dconf/user
/home/steeldriver/.local/share/zeitgeist/activity.sqlite-shm
/home/steeldriver/.local/share/zeitgeist/activity.sqlite-wal
/home/steeldriver/.lesshst
If you want to prune multiple dirs you can do so by grouping them with OR conditions
Code:
$ find ~/ \( \
-path ~/.cache -o \
-path ~/.config -o \
-path ~/.local \
\) -prune -o -mtime -1 -print
/home/steeldriver/
/home/steeldriver/.Xauthority
/home/steeldriver/somefile
/home/steeldriver/.lesshst
Bookmarks