LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-08-2005, 04:16 AM   #1
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 31
Question Sym links and hard links


I was reading about symbolic links and hard links. I'm a little confused about hard links.

Let's say I have a file ~/downloads/gaim.tgz and I make a hard link in ~/

Now, the file ~/gaim.tgz is a hard link that has the same inode number as the original file.

The confusion is that will ~/gaim.tgz actually occupy any space on my disk? Or does it report a size of 4MB because it is linked to the original by the inode number?

In other words, the link is just a reflection of the original, so it "appears" to occupy space, right?
 
Old 02-08-2005, 04:19 AM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Re: Sym links and hard links

Quote:
Originally posted by akudewan
In other words, the link is just a reflection of the original, so it "appears" to occupy space, right?
This is the way I've understood it.
Whereas, a symlink is simply a "pointer" to said file.
 
Old 02-08-2005, 11:55 PM   #3
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 31
I see. Thanks very much for the confirmation
 
Old 02-09-2005, 12:09 AM   #4
camlinux
Member
 
Registered: Feb 2003
Location: north dakota
Distribution: Gentoo, Debian
Posts: 90

Rep: Reputation: 15
While we are on this topic, at what point would a hard or a soft link be more beneficial compared to the other. I could look it up I know, and if I don't get a response I will .
 
Old 02-09-2005, 05:08 AM   #5
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 31
Hmm...well the disadvantage of a hard link is that it has to be made on the same partition.
The advantage would be that there is no "pointer" file as a link, but it is a link at a more "hardware" level.

And vice-versa for symbolic links.
I have never used a hard link ever since I started using linux.

If any of you guys have more info, do post it here
 
  


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
sym links -- RealPlayer lmellen Linux - Newbie 2 08-29-2004 02:29 PM
Dead sym links Hangdog42 Linux - General 5 10-02-2003 04:35 AM
Sym Links and vsFTPd Datacraft Linux - Software 1 05-24-2003 05:20 PM
dead sym links dewcansam Linux - General 1 02-08-2002 04:49 PM

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

All times are GMT -5. The time now is 05:56 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