I\'m using find to all files in directory, so I get a list of paths. However, I need only file names. i.e. I get ./dir1/dir2/file.txt and I want to get fi
./dir1/dir2/file.txt
fi
If your find doesn't have a -printf option you can also use basename:
find ./dir1 -type f -exec basename {} \;