simple ln question

Garry T. Williams gtwilliams at gmail.com
Sat Aug 25 22:07:36 UTC 2007


On Saturday 25 August 2007 17:26:46 tony.chamberlain at lemko.com wrote:
> I have a script that occasionally does something like this
>
>  ln file1 file2
>
> that makes it so the contents of file1 are the same as of file2, and
> if you change the contents of 1, the other changes accordingly.
>
> I can slo do this
>
>  ln -s file1 files
>
> which is somewhat similar, but of course works over file systems and
> file2 is really just a symbolic link to file1.
>
> Anyway, sometimes I want to undo what I did, but I can't say
>
>  unlink file2
>
> because that will remove file2. I just want it , so that the files
> are still the same but if I change one, the other will not change
> (i.e., inodes are different but diff shows no differences). I can't
> see any flags for ln. Anyone have any idea?

    rm file2
    cp file2 file1

-- 
Garry T. Williams --- +1 678 656-4579




More information about the users mailing list