0

I have a project at /long/ass/path/to/project that has many soft links within it.

Whenever I need to run a new batch in the project I create a link from the output of the last batch to the input of the new batch as so:

(From within: /long/ass/path/to/project/stage5:)
ln -s ../../stage4/output ./input/

Relative links don't hold very well when being moved around, so I tend to go for absolute links like so:

(From within: /long/ass/path/to/project/stage5:)
ln -s /long/ass/path/to/project/stage4/output ./input/

My question, is there a way to change the root of the link or a trick a directory into thinking it's root without blocking off the rest of the filesystem, so that I can just type:

ln -s /stage4/output ./input

  • 1
    Why you don't use hard link if you are using one Hard Disk ? – Wissam Roujoulah Dec 11 '16 at 15:16
  • I'm worried that if I write a malformed script that deletes the contents of the input folder, a hardlink would also delete the contents of file under the link. At least with softlinks, only the link is destroyed by my understanding – tetris11 Dec 12 '16 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.