shell - How to only get file name with linux `find`? -


I am using all the files in the directory to find, so I get a list of paths. However, I only need a filename i.e. I get ./ dir1 / dir2 / file.txt and give me the file.txt < P>

Find in GNU You can use the -printf parameter for this, for example To:

  find / dir1 -type fprintf "% f \ n"    

Comments