Question

I've currently got:

ls -1 $(pwd)/*

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

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

Was it helpful?

Solution

find $(pwd) -type f -print

or

find $(pwd) -type f -ls

OTHER TIPS

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

E.g.: find . -type f -print0 | xargs --null --no-run-if-empty grep

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top