Hi all,
Today on April 17, 2009, it was break time when we were just wasting
our time during the break time in College. Then, suddenly from
nowhere, it came to my mind that why don't I discuss with others (
especially the people already using Fedora and any new ones
interested) what I had learnt yesterday. I did a bit reading on links,
inodes from the System Administration Book by Oreilly.

People who joined in the discussion : Rahul Bose, Divyanshu Jaiswal,
Kishan Goyal, Ravi Kumar, Avijeet Sinha, Prateek Kundu. I started with
the basic definition of link. Then put forward the two kinds of links
: hard link and symbolic link. Explained what these mean.

Like, hard links are two or more filenames having the same inode. Then
I had to speak a bit on inode that it is the basic data structure of a
filesystem that stores information on the file and its attributes, and
its location on the disk. Generally, most of the regular files that we
see and use in our system are hard links. Hard links don't work for
directory , but only for files. And filesystems cannot be spanned via
hard linking as each filesystem has got its own set of inode numbers.

Syntax : $ ln <source file> <hard link file name>
This creates a new file in the current directory with the desired
name, but the same inode number as the source file and increments the
inode count of that particular file type by 1.

On the other hand, symbolic names are just pointers to a particular
location ( pathname) in the filesystem. It is not directly related to
the inode of the source file. The shortcuts are examples of symbolic
links. Symbolic links can be used for folders and also for spanning
filesystems as they only contain the pathname of the source. Even if
the source file gets deleted, the symbolic link exists, but trying to
access it gives error, since the concerned file doesnot exist. But if
another file with the same name as the previous source file is created
in the same location as the previous source file, the sybolic link
again gets linked with the new file. But the newly created file is now
having a different inode, thus pointing to a different location on the
disk.

Syntax : $ ln -s <source file> <s_link file name>

Then, I spoke a little on ls and its options -l, -F, -i. The -l option
is the long form of the ls command and displays info on the owner of
the files in the directory along with the type of access on the file.
The -F is for displaying special symbols showing the type of files,
and also showing the target pathname in case of symbolic link  files.
And the -i option displays the inode number of the files in the
directory. Together it can be written as :
$ ls -lFi <directory pathname>

That was all that we discussed today. I hope we can held such
discussions regularly and make it better each time.

Thanks,
Regards,
Ratnadeep Debnath | rtnpro
_______________________________________________
Users mailing list
[email protected]
http://lists.dgplug.org/listinfo.cgi/users-dgplug.org

Reply via email to