diff bet ln and cp
+4
Saradha Kannan
Navitha
Mahee
ARVINTH B.J
8 posters
diff bet ln and cp
whats ln command? whats its use?????
whats the diff bet ln command and cp command.
whats the diff bet ln command and cp command.
ARVINTH B.J- Posts : 20
Points : 31
Join date : 2010-02-26
Re: diff bet ln and cp
ln creates a link(reference) to file
cp creates a new copy of a file in the destination
cp creates a new copy of a file in the destination
Mahee- Posts : 29
Points : 233
Join date : 2010-03-03
Location : Haldia
Re: diff bet ln and cp
how ln works.
when i tried the command
$ ln j4.log empty2
It showed
ln: creating hard link `empty2' to `j4.log': File exists
when i tried the command
$ ln j4.log empty2
It showed
ln: creating hard link `empty2' to `j4.log': File exists
Navitha- Posts : 14
Points : 24
Join date : 2010-02-26
Re: diff bet ln and cp
even the referenced file has the contents in it which is same as the original file. So whts the diff? can u pls xplain.....
ARVINTH B.J- Posts : 20
Points : 31
Join date : 2010-02-26
Re: diff bet ln and cp
I got the difference between cp and ln.
After creating a link,when you modify the original file it reflects in the referenced file and viceversa.
This wont happen with the cp command.
After creating a link,when you modify the original file it reflects in the referenced file and viceversa.
This wont happen with the cp command.
ARVINTH B.J- Posts : 20
Points : 31
Join date : 2010-02-26
Re: diff bet ln and cp
i think....
its not possible to link a file to another file which already exists.
if we dont specify the type of link it by default creates the hard link.
the other is the soft(symbolic) link for which the option -s is used.
ln with no options creates a hard link, ln -f forces a hard link, ln -s creates a symbolic link, and ln -fs forces a symbolic link.
its not possible to link a file to another file which already exists.
if we dont specify the type of link it by default creates the hard link.
the other is the soft(symbolic) link for which the option -s is used.
ln with no options creates a hard link, ln -f forces a hard link, ln -s creates a symbolic link, and ln -fs forces a symbolic link.
ARVINTH B.J- Posts : 20
Points : 31
Join date : 2010-02-26
Re: diff bet ln and cp
Can u pls tel me what wud be the cmd for exercise lab session1-->
q.10: Create a link 'tmp' under FIN directory for matter,which is another directory..
q.10: Create a link 'tmp' under FIN directory for matter,which is another directory..
Saradha Kannan- Posts : 25
Points : 25
Join date : 2010-03-04
Re: diff bet ln and cp
ln name of another directory/matter tmp
this is the syntax.
Eg :- 335818
/ \
FIN HRD
\
matter
Say your directory structure is
suppose I am in directory FIN and matter is in directory HRD, then the command would be
ln ~-/HRD/matter tmp
~- refers to previous directory
this is the syntax.
Eg :- 335818
/ \
FIN HRD
\
matter
Say your directory structure is
suppose I am in directory FIN and matter is in directory HRD, then the command would be
ln ~-/HRD/matter tmp
~- refers to previous directory
Maithreyi- Posts : 76
Points : 142
Join date : 2010-03-03
Age : 36
Location : Haldia
Re: diff bet ln and cp
to be more specific, "~-" stands for previous working directory not previous directory.
the above command wont work in all situations. its better to use
- Code:
$ ln ~-/HRD/matter tmp
the above command wont work in all situations. its better to use
- Code:
$ ln /335818/HRD/matter tmp
Re: diff bet ln and cp
If I try the cmd the above cmd, i get dis error msg:
ln: accessing `/home/335837/hrd/HRD/matter': No such file or directory
What is it that is happening?
ln: accessing `/home/335837/hrd/HRD/matter': No such file or directory
What is it that is happening?
Saradha Kannan- Posts : 25
Points : 25
Join date : 2010-03-04
Re: diff bet ln and cp
since ur already in 335837 directory..../335837/hrd/matter tries to search for another 335837 directory within 335837....so try
ln hrd/HRD/matter tmp
where hrd is a directory within 335837......
ln hrd/HRD/matter tmp
where hrd is a directory within 335837......
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: diff bet ln and cp
nice explanation about hard link and symbolic link is given in wikipidea..
shivangi shah- Posts : 3
Points : 3
Join date : 2010-03-11
Age : 36
Location : Haldia
Similar topics
» diff bet $ and # in unix
» What s d diff between 'sed' and 'tr' command??
» diff bw data of d same column
» What s d diff between 'sed' and 'tr' command??
» diff bw data of d same column
Permissions in this forum:
You cannot reply to topics in this forum
|
|