find: remove directories from output

To remove the full path to your find results add:

-exec basename {} \;

to your search:

bash-4.1$ find . -type f -name "*.pdf" -exec basename {} \;

Leave a Reply

Your email address will not be published. Required fields are marked *

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