Syntax of the find utility is made more complex by the need to escape some of its switches for use in a shell, but sooner or later you will run into a situation where you have too many files that need an operation for any other tool to manage.
The first time I ran into this situation was with some software that produced a log file with each event that was processed. When I noticed the file system was getting full, there were already millions of files that needed deleting. They each had a date stamp in their names but the normal way of 'wildcarding' for the oldest files:
# rm errorlogfile-2007-01*
produced an error because the number of arguments being assembled by the globber (*) was too large.
In this case, the 'find' utility was a much better tool to use.
To find and display all files using 'ls -l' with a modification time older than 365 days. The 'ls -l' could be replaced with 'rm -f' or any other shell command.
## comment: find everything in /logdir older than 365 days & exec.
# find /logdir -mtime +365 -exec ls -l '{}' \;
The clever part of this expression follows the -exec
In this case, my command is "ls -l". The curly brackets facing each other are replaced by the file names that 'find' found. One at a time. These need to be surrounded by single quotes to prevent the shell from interpreting them. This exec statement is terminated by the semicolon - which is shell escaped by the backslash character.
Another find situation I've bumped into that took some thinking to solve was the need to omit directories from a search operation.
This uses the strange 'prune' and 'or' syntax. This example finds all files except directories (-type d) named proc. The slash escaped parens group the conditions of the files you with to wish to eliminate.
find / \( -name proc -type d \) -prune -o -exec ls -l '{}' \;