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
Why is Unix like this. % mkdir a 4 comments
@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? @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. |
@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/'