Email or username:

Password:

Forgot your password?
Dag Ågren ↙︎↙︎↙︎

Why is Unix like this.

% mkdir a
% mkdir b
% echo "what" > a/a.txt
% ln -s a/a.txt b/b.txt
% cat b/b.txt
cat: b/b.txt: No such file or directory

4 comments
Luka Prinčič

@WAHa_06x36 link is broken.

if you
% ls -al b/
you will see that
b.txt -> a/a.txt
so, that links points to a folder 'a/' inside the folder 'b/'.

you need to do
ln -s ../a/a.txt b/b.txt

relative symbolic link's path should be traced from where the link starts. in your case that's inside the folder 'b/'

Dag Ågren ↙︎↙︎↙︎

@luka Yeah, but why. Why is ln like this. Why does it not create a non-broken link instead of a broken link. Why does it just happily and silently do something useless?

Eugen Rochko

@WAHa_06x36 @luka But it allows to create symbolic links that can be moved along with the parent. I think we have/had some in the mastodon repository. It works even if the absolute path to mastodon differs.

Dag Ågren ↙︎↙︎↙︎

@Gargron @luka Yeah, that is what I was doing as well. I just find it annoying that ln will not act like cp, even though it almost acts like cp. It COULD fix the path to work.

Go Up