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 {} \;
FreeBSD_Portability_With_VMware_BSD_04_2011.pdf
Network_Security_Hakin9_02_2011.pdf

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *