Today I Learnt: Symlinks are Relative

Today I Learnt: Symlinks are Relative

If the current working directory is /Users/admin I thought the two commands should work the same.
ln -s borg-env/bin/borg /usr/local/bin/borg
ln -s /Users/admin/borg-env/bin/borg /usr/local/bin/borg

However the first one gives me “-bash: borg: command not found” when I run borg.

It only hit me when I looked closer at the output of ls -la /usr/local/bin/

Where I saw ../, turns out symlinks are relative, who knew? My first command was trying to run /usr/local/borg-env/bin/borg which didn’t exist.

Learnt and Learned are both acceptable under Aussie English.

Leave a Reply

Your email address will not be published. Required fields are marked *