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 pwd command displays the full, absolute path of the current, or working, directory. It's not something you'll use all the time, but it can be incredibly handy when you get a bit discombobulated. So there's a soft link with a source websites that points at a target /var/www. I cd using the soft link and enter pwd.
To use this command, simply type “readlink -f ” into your terminal then, type in the name of the file or folder that you want to find the path for and press enter. The output will be the file path of the specified file or folder.
The -l option signifies the long list format.
Use find:
find . find /home/dreftymac
If you want files only (omit directories, devices, etc):
find . -type f find /home/dreftymac -type f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With