How can I get ls to spit out a flat list of recursive one-per-line paths?
For example, I just want a flat listing of files with their full paths:
/home/dreftymac/.
/home/dreftymac/foo.txt
/home/dreftymac/bar.txt
/home/dreftymac/stackoverflow
/home/dreftymac/stackoverflow/alpha.txt
/home/dreftymac/stackoverflow/bravo.txt
/home/dreftymac/stackoverflow/charlie.txt
ls -a1
almost does what I need, but I do not want path fragments, I want full paths.
The easiest way for all you future people is simply:
This however, also shows the size of whats contained in each folder You can use awk to output only the folder name:
Edit- Sorry sorry, my bad. I thought it was only folders that were needed. Ill leave this here in case anyone in the future needs it anyways...
ls -ld $(find .)
if you want to sort your output by modification time:
ls -ltd $(find .)
Best command is:
tree -fi
In order to use the files but not the links, you have to remove
>
from your output:If you want to know the nature of each file, (to read only ASCII files for example) with two
while
s:Use find:
If you want files only (omit directories, devices, etc):
With having the freedom of using all possible ls options:
find -type f | xargs ls -1