Skip to main content
2 of 3
added 56 characters in body
Stilez
  • 1.3k
  • 19
  • 32

Correct location for piping and redirecting output in find -exec?

I'm using find with the -exec option in console, on FreeBSD (for example, find . -exec sha1 {} \;).

  1. How do I correctly place (and if needed, escape) redirect and other execution control symbols that could syntactically apply to either of the exec command or the find command, such as > >> | and &, where I might want the symbol to apply to the find or the exec commands on different occasions?

  2. On the same theme, what is the syntax if I want to use tee to view the output of the -exec commands on the console (to watch progress) and also appended to a file (for later use)?

(I know shells vary but hopefully the most used shells such as sh/csh are quite similar?)

Stilez
  • 1.3k
  • 19
  • 32