Tag Info

Hot answers tagged

3

Not the issue of ls. It's how symlinks work. The .. gets you into the parent of the current directory, the directory doesn't know you got to it through a symlink. The shell has to intervene to prevent this behaviour. For the shell builtin cd, there is special handling that doesn't just call chdir but memorizes the full directory path and tries to figure out ...


2

You can use the -F parameter to ls to get: -F, --classify append indicator (one of */=>@|) to entries i.e.: # ln -s videos Videos # ls -l lrwxrwxrwx. 1 guido guido 6 Jan 23 14:11 videos -> Videos # ls -lF lrwxrwxrwx. 1 guido guido 6 Jan 23 14:11 videos -> Videos/ Anyway, I'd suggest you create symlinks to directories like ...


1

bash "knows" about symlinks and tracks this info when you use a symlink to enter a directory. You can check this by doing the following in your example: $ cd /dir2 $ cd linked $ pwd /dir2/linked $ PWD='' bash -c pwd /dir1 You need to start the bash with an empty PWD variable, otherwise it uses that trick to display the "fake" path. Note that ls is a ...


1

The output of ll, which I assume is a shell alias for ls -l, does not contain this information in the mode/permissions of the symlink. On Linux (symlink(2)): The permissions of a symbolic link are irrelevant; the ownership is ignored when following the link, but is checked when removal or renam- ing of the link is requested and the link is ...


1

While replacing symbolic links to directories we should use -n option. Example: ln -sfn /path/to/directory /target/directory



Only top voted, non community-wiki answers of a minimum length are eligible