Reputation: 765
I am trying to list the absolute path to all files in a given directory and all its subdirectories. I can almost get there using
ls -LR | xargs realpath
The only issue is that this also includes the paths to the individual subdirectories followed by a colon, i.e.
/path/to/subdirectory:
However, I am only looking to get a list of paths to files. Can someone help out here?
Upvotes: 1
Views: 42
Reputation: 312086
It's probably possible with some combination of ls
and realpath
, but I think that using find
with a filter on the type will be much easier:
find . -type f
Upvotes: 0