$cp file_from file_to
and that
$ln -s link_from link_to
has a very similar effect to the cp command above. I haven't messed this up ever since.
$cp file_from file_to
and that
$ln -s link_from link_to
has a very similar effect to the cp command above. I haven't messed this up ever since.
`$ ln -s link_from link_to` would imply the reverse behavior. How does a symlink point from the actual file to the thing-that-looks-like-a-file-but-is-really-a-symlink? The file doesn't even know whether there are symlinks pointing to it.
Applying your definitions of "link from" and "link to", this:
<a href="http://google.com/>Google</a>;
creates a link from google.com to the hyperlink on your site.
I find the top reddit comment:
cp existing new
ln -s existing new
much, much more useful. You want to create a new link pointing to an existing file, which has the same ordering as when you use cp to create a new file with the content of an existing file.It took me a long time till I realized that saying it thus made me always recall it properly.
cp existing_thing new_thing
ln -s existing_thing new_thing ln -s 'the one that exists' 'the one that doesnt exist'
I actually say that to myself as I'm typing the command. Since I started doing that, I've never gotten it wrong.Also I wonder how many people can say the same thing as the article and still get upvoted.
Is the "from" the file/dir I want to copy "to" a link?
Or is the "from" the name of a link I want to point "to"?
The dual meaning of some terms that the concept of links and making links creates causes a lot of this confusion, IMHO. Are we using terminology that refers to the act of creating the link or that refers to the direction of the link?
Similarly, I don't think it helps that the usage text and manpage for ln refer to "target"s.
(I know what you mean by your examples but I wanted to share my pet theory as to why this is always so hard to remember)
And people say Linux isn't user-friendly! :)
cp -l from to $chown user1 file1
$chown user1 file2
$ln -s file1 file2
$ln -s file1 file3
...seems more likely than... $chown user1 file1
$chown user2 file1
$ln -s file1 file2
$ln -s file3 file2flip would actually be quite useful for me on grep. I often search the some corpus of text, but change the pattern.
I am often guilty of this myself. At first I used to read all of the stories that were linked to on HN, along with the comments. But I quickly learned that the comments were often much more interesting/useful than the stories themselves.
So now I just look at the comments first, by default. And only in exceptional cases do I actually bother to read the article. There's just not enough time..
HN is an overwhelming firehose of information even without reading every article that seems interesting. But reading the comments can usually quickly give you a good feel for whether the story is worth reading or not. In this particular case, I think not.