On Sun, 06 May 2007 14:46:22 +0200, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:
> Michael Henry wrote: > > Gary Johnson wrote: > >> On 2007-05-05, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > >>> (Warning: In the "ln" command as used here, the target name comes > >>> before the link name. I find this counter-intuitive.) > >> > >> It's not just me then. I have to think carefully about that every > >> time I use ln. > > > > I used to find this hard to remember until I realized that 'ln' and 'cp' > > are very similar. The 'cp' command copies one or more sources to a > > destination; the 'ln' command links one or more sources to a destination > > as well. I tend to think of 'ln -s' as "copy using symlinks". The > > order and meaning of the arguments is the same between the commands, > > which I now find consistent and intuitive. > > The problem is, "cp -v file1 file2" outputs > > `file1' -> `file2' > > ("the data has been copied from file1 to file2") but "ln -sv file1 file2" > outputs > > file2 -> file1 > > ("file2 is now a link pointing to file1"). I still have to call up the help > or > the manual every time I invoke it. Just remember that for all of cp, ln and mv, the existing file comes first. I think the confusion arises because people think of ln as "create a link", so they see "ln x y" as "create a link x...", which it isn't. It makes more sense if you think of it this way: mv x y move file x to file y cp x y copy file x to file y ln x y link file x to file y -- Matthew Winn