How to memorize the order of parameters to `ln` command? [closed]
Asked Answered
L

1

14

I don't use ln command on daily basis, so when I need to create a link to a file, I always forget whether it's ln <target file> <link name>, or ln <link name> <target file>, so I have to take a quick glance at man ln.

As ln is commonly used in the process of software development, having the order firmly in memory would tremendously boost productivity.

Do you have any tricks (mnemonic?) for remembering the order of ln parameters?

Lionhearted answered 7/5, 2014 at 18:30 Comment(2)
If you hesitate, type ln --help ...Dare
I was finally able to learn it after I remembered that the last part of second argument is the one that you have to make up - it does not exists before. Like this, when making non-version link to newest Netbeans version: ln -s $HOME/install/netbeans/netbeans8.0.2 $HOME/install/netbeans/netbeansCylindroid
E
35

It takes arguments in the same order as cp and mv.

Euphemia answered 7/5, 2014 at 18:32 Comment(3)
cp <existing-thing> <new-thing> mv <existing-thing> <new-thing> ln <existing-thing> <new-thing>Convalescence
I think of it as cp <from> <to>, mv <from> <to> and ln <from> <to>Whiffler
I think the reason <existing> <new> is better than <from> <to> is that the latter has the ambiguity that once the link exists, if it's a symbolic link, it takes you to the from.Symphonious

© 2022 - 2024 — McMap. All rights reserved.