3 ms·
What came first: the file or the symlink? Of course the real file came first! Mnemnic that helps me: IN SYMLINKS, REAL FIRST! ln -s REAL_FILE link_name
by freetonik 7y ago
What came first: the file or the symlink? Of course the real file came first!
Mnemnic that helps me: IN SYMLINKS, REAL FIRST!
ln -s REAL_FILE link_name
- deleted 7y ago[deleted]
- wereHamster 7y agoI know of two different ways to remember: 1. Same as mv: `mv REAL_FILE link_name` 2. The second argument is optional. Therefore, the first argument must be the real file, and the second the link name. It does not make sense to omit the real file.
- huherto 7y agoThis. Same as mv AND cp.
- inimino 7y agoTwo minor points: They are both real files. The symlink may be created first. "Source" and "target" are confusing names because the target of the ln command is the file it creates, which is the symlink that points to the source file, which is the "target" of the symlink in an intuitive sense. The mnemonic works because it matches mv and in that case the file that exists must obviously come first. In ln without -s the file also must exist, which makes perfect sense. So it's easy enough to remember if you understand what the ln semantics are and don't get hung up by the source and target jargon.