Suppose I have a directory /dir
inside which there are 3 symlinks to other directories
/dir/dir11
, /dir/dir12
, and /dir/dir13
find /dir -type f -follow -print
-type f
means it will display real files (not symlinks)
-follow
means it will follow your directory symlinks
-print
will cause it to display the filenames.
If you want a ls type display, you can do the following
find /dir -type f -follow -print|xargs ls -l
Using ls:
ls -LR
from 'man ls':
-L, --dereference
when showing file information for a symbolic link, show informa‐
tion for the file the link references rather than for the link
itself
Or, using find:
find -L .
From the find manpage:
-L Follow symbolic links.
If you find you want to only follow a few symbolic links (like maybe just the toplevel ones you mentioned), you should look at the -H option, which only follows symlinks that you pass to it on the commandline.