I have a bunch of symlinks pointing to various directories. Each of the target directories happen to have a space in them, I have not created them like that, but they are being received as such via zip files.
This boils down to the following command not working, due to the spaces:
ll $(readlink <symlink name>)
And in general, I am looking for a way to more
, tree
, ls
, and similar commands, using the symlink names such that these bash commands will operate on the target directory of the symlinks. It sounds odd but I failed finding existing answers so I'm not sure this is actually supported in bash.
Is there any elegant way to refer to symlinks in a way that bash would always simply dereference them to their targets, without relying on command-specific flags?
ls
does that automatically. – Wieland May 11 '19 at 20:49ls
, can't seem to get the dereferencing to work, for some reason. it will only show the symlink's definition, but not follow it. maybe the spaces in the target directory names are to blame, not sure. – matanox May 11 '19 at 20:56