symlink confusion
Joshua Judson Rosen
rozzin at hackerposse.com
Sat Nov 14 16:48:05 EST 2015
On 11/14/2015 04:27 PM, Ric Werme wrote:
>
>> Sorry about this primitive question, sometimes I get confused about
>> the order. As I have found online, the description is
>
>> ln -s /path/to/file path/to/symlink.
>
>> However, this still confuses me. Which is which in my example?
>
> Yeah, that's pretty poor wording. I gave up on it a long time ago.
>
>> Can someone enlighten me? TIA.
>
> I remember that it's much like cp, as is ln for hard links:
>
> cp file-that-exists new-file
>
> ln file-that-exists new-directory-entry
>
> ln -s file-that-exists new-symlink
That's an interesting point, actually--especially because,
these days, you can actually use "cp" to create symlinks, too--
you just need to do:
cp -s file-that-exists new-file
And then it is _really_ `just like using cp' ;)
> Where "file-that-exists" really refers to a "directory entry" and the
> file, or "bag of bits" that the directory entry points to.
>
> Or, in the symlink case, "file-that-exists" doesn't have to exist. Try
> not to remember that, except when it's important.
And that's the case in which you really need to use the "ln command",
because "cp" won't operate on nonexistent files, even when it's "cp -s" ☺
(it also won't make symlinks to directories, but instead recurses
and just symlinks the leaf nodes)
--
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."
More information about the gnhlug-discuss
mailing list