-exec

The find action that runs a command on the entries it finds, with {} standing for each file name.

In more detail

Ending it with + passes many names to one command, like xargs, and ending it with \; runs the command once per file. Either way file names arrive as separate arguments, so spaces and newlines in names are safe.

Example

find data -name "*.log" -exec grep -c start {} +

Related terms

Taught in

References

Certification courses