Current versions of find assume print as default unless directed to do something else.
find will print found files when used with simple test conditions
However, when using compound conditional tests specified, a specific action option may be required.
find . -name core -exec rm -i {} \;
will find all core files and if you OK it, it will delete. rm asks.
The {} required to pass each found file to command.
The \; terminates the command sequence. Backslash needed so cmd-interpreter does see it. find . -name "*.c" -exec grep -l "groovy.h" {} \; # finds all c files and checks for any reference to groovy.h and prints it # if it finds it.
Because it returns true, use -o option to add actions for anything else.
find . -path evals -prune -o -path backups -prune -o -size +20k -a -name "*.txt" -print 2> /dev/null | less
Test files found in starting directory, in this case, current directory. If file name is evals prune - stop further processing of that file or directory. Else (-o) # file not called evals If file name is backups prune - stop further processing of that file or directory. Else (-o) If size of file is 20 Kor greater and name as a txt extension print filename. Redirect any errors to /dev/null and any finds to less.