By using "ln -s a b", it creates a soft-link from b to a with a relative path. If 'b' is moved to another directory, it would get broken.
Is there any way so I can create an link with an absolute path?
By using "ln -s a b", it creates a soft-link from b to a with a relative path. If 'b' is moved to another directory, it would get broken.
Is there any way so I can create an link with an absolute path?
Simply use the full path to the link target:
ln -s /full/path/to/a b
ln -s `readlink -f a` b
–
Havstad © 2022 - 2024 — McMap. All rights reserved.
man ln
. It will save you many headaches in the future. – Varian