find’s printf action

If you use find, it outputs full paths, which may not always be desirable. Turns out find has a -printf action with which you can do  niceties such as outputting plain filenames (as if you’d used basename on them, but this means one less command on your pipeline):

The -printf command has a lot of formatting variables and possibilites! give it a try, look at the man page for more information.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.