Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Kind of how the ln command in unix works, then? I've always found this massively unintuitive.
How Do I Make This Hard to Misuse?
Posted Apr 7, 2008 14:38 UTC (Mon) by nix (subscriber, #2304)
So do I, but I think that's because of overexposure to C, where that sort
of thing is helpfully always the other way around.
If you think about it, ln(1) is perfectly consistent with cp(1): it
creates or updates (for directories) the last thing you list.
Posted Apr 7, 2008 17:17 UTC (Mon) by vmole (guest, #111)
It's consistent, kinda. The problem comes when describing: "cp foo bar" translates as "copy _foo_ to _bar_" okay, but the obvious translation of "ln foo bar" to "link _foo_ to _bar_" doesn't; the latter seems to say _bar_ is the original, at least to my taste. You have to process it as "create a link to _foo_ named _bar_". Or just memorize it. :-)
Posted Apr 8, 2008 8:24 UTC (Tue) by IkeTo (subscriber, #2122)
> but the obvious translation of "ln foo bar" to "link _foo_ to _bar_" doesn't
I see this problem as an inaccuracy of the translation "link _foo_ to _bar_". This seems to
imply that both _foo_ and _bar_ are pre-existing, and somehow a "link" is created between them
as a result of running the command. Obviously not what is done by "ln". It is instead to
"build a link to _foo_ called _bar_". The cp is to "make a copy of _foo_ called _bar_".
Pretty consistent to me.
Posted Apr 8, 2008 12:13 UTC (Tue) by jzbiciak (✭ supporter ✭, #5246)
Although, since the final argument can be a directory, perhaps the best connector for both is
Make a copy of foo _at_ bar
Make a link to foo _at_ bar
Or in the plural case:
Make copies of foo, bar, baz, quux _at_ dest
Make links to foo, bar, baz, quux _at_ dest
Posted Apr 9, 2008 3:06 UTC (Wed) by roelofs (guest, #2599)
ln -s foo/bar .
ln -s foo/bar
...are equivalent. Sadly, cp foo/bar doesn't quite work.
Posted Apr 9, 2008 3:33 UTC (Wed) by jzbiciak (✭ supporter ✭, #5246)
That aspect of 'cp' always drove me nuts, probably because I learned MS-DOS first. I've found
myself tempted to write a wrapper around 'cp' to make that form work.
I won't, though, only because I know it'll wreak havoc when I go to use someone else's account
for whatever reason. (e.g. to show them how to do something.)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds