Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-16-2009, 11:31 AM   #1
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up files

Hey can anybody say the difference between hard link file and soft link files with example. Please don't suggest any websites. I want your knowledge because that helps me to understand better than the website. Thanks.
Old 02-16-2009, 11:44 AM   #2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Old 02-16-2009, 03:33 PM   #3
LQ Newbie
Registered: Feb 2009
Location: St Paul, Minnesota, USA
Distribution: Redhat Fedora 10; someday planet CCRMA
Posts: 11

Rep: Reputation: 0
Let me guess: by soft link do you mean symlink, like a Windows shortcut?
A symlink only stores the pathname of a "real" file that can be on a different volume etc. If you move the file, you "break" the symlink. It now points at where the file WAS, not where you moved it to.

The other kind of link is often called a "hard link." In a classic unix filesystem, when the disk is formatted, its space is divided between a table of "inodes" and the space normally used for holding files' data. Every real file on the disk has exactly one inode. A directory basically maps a name within that directory to an inode number. If you tell the system to link x/y/z to /a/b/c, you are saying to take the same inode number as /a/b/c and put it in the directory x/y for name z.

You can only (hard) link files that are on the same filesystem.

There is no difference between a hard link and the "original" file. The directory entries both specify the inode number of the file, so you can think of the inode as the "real" name of the file.

The ls -l command tells how many hard links there are to each file. Some other option will list the inode number the filename in the directory points to.
Old 02-16-2009, 11:01 PM   #4
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Original Poster
Rep: Reputation: 33
Thumbs up Thanks

Thanks friends. Awesome reply. i got it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
in copy files or ls files the command want to invert select some files how to?? hocheetiong Linux - Newbie 3 06-27-2008 06:32 AM
Doom 3: Using native installer and can't locate saved game files or config files JBailey742 Linux - Games 11 08-14-2006 06:09 PM
converting a doc/ppt Windows files in html files under linux env agrosu Programming 7 02-23-2006 03:07 PM
How program to read files with extension .dat y .cfg files COMTRADE in fedora 1? ivonne Linux - Software 0 11-22-2004 11:42 AM
How to filter files in files and files which are in a sub-directory with "grep"? Piero Linux - Newbie 9 08-29-2003 02:38 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:47 PM.

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