LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2004, 02:14 PM   #1
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Question Soft vs. Hard Links


I've been reading about the ln command, and I'm a little confused. Is there any reason you'd ever want to create a symlink instead of a hard link if the two files are on the same filesystem? It seems to me that the only reason a symlink would be better is if a hard link wouldn't work in a particular situation.

Thanks
Johnathan
 
Old 06-13-2004, 02:29 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Let's say that a hard link doesn't show up as a link
in ls ... you're running the risk of deleting a file
because it has two different names in different
places, both have a "normal" size, none of them
indicates (other than the number of links you'll
see in ls) that it may be a link ;) But if you're used
to looking at that value you probably won't have
that problem.

Personally I just like things like

Code:
 ls -l /dev/cdrom 
lrwxrwxrwx    1 root     root            9 2004-03-17 13:41 /dev/cdrom -> /dev/scd0

Cheers,
Tink

Last edited by Tinkster; 06-13-2004 at 03:59 PM.
 
Old 06-13-2004, 02:41 PM   #3
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
Ok, now that makes sense. Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
links (hard links and soft links..) sachitha Programming 1 08-10-2005 12:10 PM
Soft Links varunbihani Linux - Newbie 3 06-04-2005 11:42 PM
Hard/Soft Links nodger Linux - General 1 05-15-2004 10:36 AM
Soft Links tonphi Red Hat 1 09-22-2003 09:20 PM
Soft Links Resqtech Linux - Newbie 4 08-26-2001 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration