[cs631apue] problem about hard link

yluo4 yluo4 at stevens.edu
Fri Sep 21 11:27:58 EDT 2012


  I use the stevens linux-lab.
yluo4 at gump:~$ echo moo > file1
yluo4 at gump:~$ ln file1 file2
yluo4 at gump:~$ ls -li file1 file2
564 -rw-r--r--+ 2 yluo4 student 4 Sep 21 11:17 file1(the color of file1 
is blue)
564 -rw-r--r--+ 2 yluo4 student 4 Sep 21 11:17 file2(blue)
yluo4 at gump:~$ emacs file2
[edit]
C-x C-s
C-x C-C
yluo4 at gump:~$ cat file1
moo
yluo4 at gump:~$ cat file2
moo
foo
yluo4 at gump:~$ ls -li file1 file2
564 -rw-r--r--+ 2 yluo4 student 4 Sep 21 11:17 file1(blue)
566 -rw-r--r--+ 1 yluo4 student 8 Sep 21 11:18 file2(not blue)
I find a file named 'file2~' is created automatically and his name is 
blue.  When I open it using emacs, it only contains 'moo' and it is 
read-only.




More information about the cs631apue mailing list