4 ms·
Hot tip: when making a symlink to a directory, include the trailing slash ('ln -s dirname/ linkname') so that if the directory disappears, a copy to the link re
by thanatos519 5y ago
Hot tip: when making a symlink to a directory, include the trailing slash ('ln -s dirname/ linkname') so that if the directory disappears, a copy to the link results in an error instead of creating a file called 'linkname'.
- CGamesPlay 5y agoDo you mean a file called dirname? Interesting behavior in either case.
- deleted 5y ago[deleted]
- leephillips 5y agoNo, `linkname` is correct. It’s the name of the link in the example. So the command `cp <file> linkname/` will give you an error if the taget is gone.
- vicaya 5y agoNo, `dirname` is correct. The goal of `ln -s dirname/ linkname` is that even if you accidentally do `cp file linkname` (note without slash) when dirname is gone, it will error out. Without the trailing slash in the ln command, a file (instead of directory) named dirname will be created.