I need to create a list of files in a directory and all of its subdirectories. I've used
find . -type f
to get the list of files, but I only need the file name, not the path that leads to it.
So instead of returning this:
./temp2/temp3/file3.txt
./temp2/file2.txt
./file.txt
I need to return
file3.txt
file2.txt
file.txt
find . -type f -exec basename {} \;
or better yet:
find . -type f -printf "%f\n"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments