changes made to a file are also made in his copy

Ed Greshko ed.greshko at greshko.com
Fri Jul 4 07:35:14 UTC 2014


On 07/04/14 14:04, angelo.moreschini at medident-sw.it wrote:
> I apologize for a trivial question but that's because I yet have not much experience with Linux.
>
> I made, some time ago, a copy of the smb.conf file, for security reasons, before making to it any changes:
> (cp smb.conf.original smb.conf.original.orig )
>
> Yesterday I wanted to give a look at the contents of the old file(smb.conf.original)that I had copied; butI found that both files have the same content.
>
> I made other changes, in order to do experiments, and I have always seen that the changes made to a file are always shown on the other file.
>
> The command "ls -l" shows the two files are colored blue which (I think) indicates that the files are a link to each other.
>
> Since I am convinced that I used the "cp" command;my question is:
> which mistake can I have made ​​to create a link of the fileinstead of a copy of it?

I don't rely on colors....

egreshko at meimei ~]$ ls -li nvidia*
8651522 -rw-rw-r--. 2 egreshko egreshko 135 Jan 30 07:29 nvidia
8651522 -rw-rw-r--. 2 egreshko egreshko 135 Jan 30 07:29 nvidia.orig

The i in the above shows the inode to be equal.  Meaning the files are hard linked.

[egreshko at meimei ~]$ ls -li nvidia*
8651522 -rw-rw-r--. 1 egreshko egreshko 135 Jan 30 07:29 nvidia
8652457 lrwxrwxrwx. 1 egreshko egreshko   6 Jul  4 15:34 nvidia.orig -> nvidia

Shows the inode to be different.  But noticed the way nvidia.org is presented.  This is a symbolic link.

-- 
If you can't laugh at yourself, others will gladly oblige.


More information about the users mailing list