ls command: how can I get a recursive full-path listing, one line per file? ls command: how can I get a recursive full-path listing, one line per file? bash bash

ls command: how can I get a recursive full-path listing, one line per file?


Use find:

find .find /home/dreftymac

If you want files only (omit directories, devices, etc):

find . -type ffind /home/dreftymac -type f


If you really want to use ls, then format its output using awk:

ls -R /path | awk '/:$/&&f{s=$0;f=0}/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}NF&&f{ print s"/"$0 }'


ls -ld $(find .)

if you want to sort your output by modification time:

ls -ltd $(find .)