How to strip leading “./” in unix “find”?

Find only regular files under current directory, and print them without “./” prefix:

find -type f -printf '%P\n'

From man find, description of -printf format:

%P     File’s name with the name of the command line argument under which it was found removed.

Leave a Comment