Php developers,Php Tutorials ,Web development, Web Developers, Php hosting, open-source,community
 
Serving the LAMP developers all over the word
LampDevelopers is a pure LAMP Developers community
Php developers,Php Tutorials ,Web development, Web Developers, Php hosting, open-source,community
LAMP Developers
   
   
   
   
   
   
Web Development
   
Developer / Programmer
   
Related Links
   
Member
   
Enter Keyword
Managing file links.

Links let you give a single file more than one name. Files are actually identified by the system by their inode number , which is just the unique file system identifier for the file. A directory is actually a listing of inode numbers with their corresponding filenames. Each filename in a directory is a link to a particular inode

1. Hard links

The ln command is used to create multiple links for one file. For example, let's say that you have a file called foo in a directory. Using ls -i , you can look at the inode number for this file.

Here, foo has an inode number of 22192 in the file system. You can create another link to foo , named bar , as follows:

With ls -i , you see that the two files have the same inode.

Now, specifying either foo or bar will access the same file. If you make changes to foo , those changes appear in bar as well. For all purposes, foo and bar are the same file.

These links are known as hard links because they create a direct link to an inode. Note that you can hard-link files only when they're on the same file system; symbolic links (see below) don't have this restriction.

When you delete a file with rm , you are actually only deleting one link to a file. If you use the command

then only the link named foo is deleted, bar will still exist. A file is only truly deleted on the system when it has no links to it. Usually, files have only one link, so using the rm command deletes the file. However, if a file has multiple links to it, using rm will delete only a single link; in order to delete the file, you must delete all links to the file.

As it turns out, a directory is actually just a file containing information about link-to-inode associations. Also, every directory contains at least two hard links: `` . '' (a link pointing to itself), and `` .. '' (a link pointing to the parent directory). The root directory ( / ) `` .. '' link just points back to / . (In other words, the parent of the root directory is the root directory itself.)

2. Symbolic links.

Symbolic links, or symlinks , are another type of link, which are different from hard links. A symbolic link lets you give a file another name, but doesn't link the file by inode.

The command ln -s creates a symbolic link to a file. For example, if you use the command

you will create a symbolic link named bar that points to the file foo . If you use ls -i , you'll see that the two files have different inodes, indeed.

However, using ls -l , we see that the file bar is a symlink pointing to foo .

The file permissions on a symbolic link are not used (they always appear as rwxrwxrwx ). Instead, the permissions on the symbolic link are determined by the permissions on the target of the symbolic link (in our example, the file foo ).

Functionally, hard links and symbolic links are similar, but there are differences. For one thing, you can create a symbolic link to a file that doesn't exist; the same is not true for hard links. Symbolic links are processed by the kernel differently than are hard links, which is just a technical difference but sometimes an important one. Symbolic links are helpful because they identify the file they point to; with hard links, there is no easy way to determine which files are linked to the same inode.

Links are used in many places on the Linux system. Symbolic links are especially important to the shared library images in /lib ..    

News
this is the news
this is the news this is the news this is the news....
openWYSIWYG 1.01 bet....
small description
Links