How to recursively list all files and directories

How about this:

find . -exec ls -dl \{\} \; | awk '{print $3, $4, $9}'

Use tree. Few linux distributions install it by default (in these dark days of only GUIs :-), but it's always available in the standard repositories. It should be available for *BSD also, see http://mama.indstate.edu/users/ice/tree/

Use:

tree -p -u -g -f -i

or

tree -p -u -g -f

or check the man page for many other useful arguments.


Works in Linux Debian:

find $PWD -type f     

find comes close:

find . -printf "%u %g %p\n"

There is also "%P", which removes the prefix from the filename, if you want the paths to be relative to the specified directory.

Note that this is GNU find, I don't know if the BSD find also supports -printf.

Tags:

Linux

Shell