1

Is it possible somehow find feature -printf print out at the moment it's used into stderr ?

  • 2
    Could you give us a few more details about the use case here? Will -printf be the only thing that find will be outputting or will you combine it with something like -ls and you only want the -printf to go to stderr? I mean, are you just looking for find . -printf '%f\n' 2>/dev/null? – terdon Apr 02 '21 at 14:24

1 Answers1

4

Assumptions:

  • GNU find;
  • you don't want to redirect the stdout of find as a whole.

Then don't think -printf can be redirected. But there is -fprintf. Use it with /dev/stderr or equivalent path.

Action: -fprintf file format
True; like -printf but write to file […]

(source)