6 ms·
> how to create a symbolic link under Linux. I just can't figure out a way to remember what comes first Remember it like this: It's the same syntax as "cp". T
by unoti 7y ago
> how to create a symbolic link under Linux. I just can't figure out a way to remember what comes first
Remember it like this: It's the same syntax as "cp". To copy a file you use "cp source dest". It's the same for ln: "ln -s source dest"
- rohit2412 7y agoI always think of links as pointing from source to destination. Your way would break that intuition for me. It would be the source of the address and the destination for the address to be copied to.
- unoti 7y agoI understand fully; that’s also how I thought of it for years and why I couldn’t ever remember it. But if you think about it like copying a file it’s easier to remember. And it is like copying a file— it’s copying a reference to a file.
- bonoboTP 7y agoRemember it like this: just as in cp, the file that already exists comes first, the file/link we are creating now comes second.
- Izkata 7y agoTry taking the command a step back with hardlinks: ln source dest The association with cp makes a lot more sense then. This is how I learned it.