List of all files in a directory with empty paths (excluding directories)

I have:

ls -1 $(pwd)/*

      

Gives me all the files in a directory with absolute paths - but formats it with a directory at the beginning of each file list.

Is there a way to get the list of files in a directory recursively (absolute paths) - excluding the directory / subdirectories themselves?

+2


source to share


2 answers


find $(pwd) -type f -print

      

or



find $(pwd) -type f -ls

      

+4


source


If you're feeding it something else, you might want to -print0 (handle filenames with spaces).



For example: find. -type f -print0 | xargs --null --no-run-if-empty grep

0


source







All Articles