Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 797 Bytes

ln.md

File metadata and controls

26 lines (17 loc) · 797 Bytes

Broken link

ln -s ad.1 /man/man1/active-dir # /man/man1/: active-dir -> ad.1

We now have a broken link since ad.1 isn't a valid path from within man1/,
ln stores the path we give literally, without any check

Solution: use ~/ad.1 which is resolvable from within man1/

Make sure we create a link named man1, NOT a link within a folder named man1/

ln -sT ~/ad.1 /man/man1 # /man/: man1 -> ~/ad.1

Race condition: if man1/ gets created before ln finishes, ensure ln fails, we don't want a link inside man1/

We do now want our link to go inside man1/

ln -st /man/man1/ ~/ad.1 # /man/man1/: ad.1 -> ~/ad.1

Race condition: if man1/ gets deleted before ln finishes, ensure ln fails, we don't want a link named man1