News for hackers. Stuff that matters.
Re:Everything I googled in a week as a professional software... by freetonik on Friday September 06, 2019 @01:44PM (#20897833)
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

Re:Everything I googled in a week as a professional software... by wereHamster on Friday September 06, 2019 @01:59PM (#20898025)
I 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.

Re:Everything I googled in a week as a professional software... by huherto on Friday September 06, 2019 @02:07PM (#20898098)
This. Same as mv AND cp.
Re:Everything I googled in a week as a professional software... by inimino on Friday September 06, 2019 @04:34PM (#20899631)
Two 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.