Is there anything that could help me memorise the argument order of the ln command?

I’ll take anything from little helper phrases over shell extensions to replacements written in Rust. I only use the command occasionally, but I need a fool-proof solution. Do you have any tricks to get it right?

@linuxquestions

#AskFedi #Linux

  • tiramichu@lemm.ee
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    18 hours ago

    I can understand OP’s confusion, though.

    For move and copy it’s pretty certain which is the ‘from’ and which is the ‘to’ - the order intuitively makes sense.

    For symlinks it’s more ambiguous based on your personal mental model.

    For example, if you think about symlinks from the perspective of the original file before a link is created, then the original file represents the ‘from’ and the link is the ‘to’ (CORRECT)

    But if you are thinking from the perspective of using a link after it’s created, then you can easily imagine the symlink as the ‘from’ - because that’s where you start when you follow it, and the target file/dir as the ‘to’ - because that’s where you arrive after following it. (INCORRECT)

    So I totally get the ambiguity.