I’m trying to create a single relative symlink pointing public/train/train back to public/train, but my command ends up nesting infinitely. For example:
ln -snrf "$ROOT/public/train" "$ROOT/public/train/train" After running this, I see:
public/ └─ train/ ├─ train → ../train │ └─ train → ../../train │ └─ train → ../../../train │ … But I only want:
public/ └─ train/ └─ train → ../train I need to keep the -r option so that the link target is relative. How can I create exactly one public/train/train→public/train symlink without further nesting?
tree? If so, which version?-roption is only relevant if the link text is a relative path, it has no effect if$ROOTis absolute.treecommand that has a problem with it. It should work for other purposes. E.g. if you have a file namedpublic/train/foo, you should be able to access it usingpublic/train/train/fooas well.