Descend at most levels (a non-negative integer) levels of directories below the starting-points. -maxdepth 0 means only
-print0
print the full file name on the standard output, followed by a null character (instead of the newline charactes that -print uses)
-exec command ;
{} expands to the filename of each file or directory found with find, ; Says that for each found result, the command (in this case ‘grep’) is executed once with the found result
-exec command {} +
run the specified command on the selected files, but the command line is built by appending each selected file name at the end; the total number of invocations of the command will be much less than the number of matched files.
find /usr -size +10M
find . -exec xxx {} ;
Find configuration data
find /etc -type f -exec grep -FHi “ENCRYPTION_PASSWORD” {} +
grep -r ENCRYPTION_PASSWORD /etc 2>/dev/null
find /etc -type f -print0 | xargs -0 grep ENCRYPTION_PASSWORD
Find biggest files
find ~/ -type f -exec du -Sh {} + | sort -rh | head -n 5
Input items are terminated by a null character instead of by whitespace, handle space or new line in file name. The find -print0 option produces input suitable for this mode
-I replace-str
Replace occurrences of replace-str in the initial-arguments with names read from standard input.
-n max-args, –max-args=max-args
Use at most max-args arguments per command line, default 5000
-t
print each command prior execution
-p
print each command and ask to execute it
-x
make xargs quit if the nummber of arguments does not fit into the command line length