Hi,
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; but I 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 file instead of a copy of it?
Thank you
Regards
Angelo
On 07/04/14 01:04, angelo.moreschini@medident-sw.it wrote: <>
The command "ls -l" shows the two files are colored blue which (I think) indicates that the files are a link to each other.
this is true.
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 file instead of a copy of it?
may not be a mistake.
"cp" is correct to usage to make a copy to a new file name.
run the command "man cp" to see arguments for "cp".
if you use "cp -l" it will make a link.
therefore, you may have an _alias_ that is causing problem.
to see if so, use the command of "alias" to see a list of your aliases.
for my environment, i have;
]$ alias|grep cp alias cp='cp -i' ]$
hth.
On 07/04/14 14:04, angelo.moreschini@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@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@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.
On 07/04/2014 12:35 AM, Ed Greshko wrote:
I don't rely on colors....
Neither do I, because I've found it to be almost impossible to find out exactly what each color means. One of the first things I add to ~/.bashrc is this line:
alias ls=ls
I put this down at the bottom to override any "helpful" aliasing that gets put in by default.
On 07/04/14 02:40, Joe Zeff wrote:
On 07/04/2014 12:35 AM, Ed Greshko wrote:
<<>>
all of which is good information.
but, does answer question of his "cp" making links and why i suggested he run "alias" to see what he has for aliases. ;-)
nap time on this side of the 'big pond'. later.
all of which is good information.
but, does answer question of his "cp" making links and why i suggested he run "alias" to see what he has for aliases. ;-)
============
Hi,
thanks for your answers ..
Now I have a clearer idea of the problem that, however, I have to better investigate.
regards
Angelo