Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
symlink creation
Results 1 to 3 of 3

Thread: symlink creation

  1. #1

    symlink creation

    i am using red hat linux 9.0 , i have tried to make hardlink and softlink,
    i want to know what is the diference between these two , and how to create a shortcut on root with links.
    pl help me ,
    thanks and regards
    pansare vaibhav

  2. #2
    Newbie
    Join Date
    Nov 2005
    Location
    Bangalore, South India
    Posts
    1
    Unix files consist of two parts: the data part and the filename part.

    The data part is associated with something called an 'inode'. The inode carries the map of where the data is, the file permissions, etc. for the data.

    The filename part carries a name and an associated inode number.

    More than one filename can reference the same inode number; these files are said to be 'hard linked' together.

    On the other hand, there's a special file type whose data part carries a path to another file. Since it is a special file, the OS recognizes the data as a path, and redirects opens, reads, and writes so that, instead of accessing the data within the special file, they access the data in the file named by the data in the special file. This special file is called a 'soft link' or a 'symbolic link' (aka a 'symlink').

    Let's go in action now :

    Hard Links :

    ashish@ash:~/test$ ls -lia
    total 8
    51956 drwxr-xr-x 2 ashish ashish 4096 2005-10-30 22:23 .
    16161 drwxr-xr-x 53 ashish ashish 4096 2005-10-30 22:23 ..

    ashish@ash:~/test$ echo "Ubuntu rocks" > ubu
    ashish@ash:~/test$ ls -lia
    total 12
    51956 drwxr-xr-x 2 ashish ashish 4096 2005-10-30 22:25 .
    16161 drwxr-xr-x 53 ashish ashish 4096 2005-10-30 22:23 ..
    51957 -rw-r--r-- 1 ashish ashish 13 2005-10-30 22:25 ubu

    ashish@ash:~/test$ cat ubu
    Ubuntu rocks
    ashish@ash:~/test$ ln ubu hardlink.file
    ashish@ash:~/test$ ls -lia
    total 16
    51956 drwxr-xr-x 2 ashish ashish 4096 2005-10-30 22:26 .
    16161 drwxr-xr-x 53 ashish ashish 4096 2005-10-30 22:23 ..
    51957 -rw-r--r-- 2 ashish ashish 13 2005-10-30 22:25 hardlink.file
    51957 -rw-r--r-- 2 ashish ashish 13 2005-10-30 22:25 ubu
    ashish@ash:~/test$

    In the above example, we see that hardlink.file and ubu both share the same inode number.

    This is, 51957 (Inode Number).

    Soft Links :

    ashish@ash:~/test$ ln -s softlink ash
    ashish@ash:~/test$ ls -lia
    total 16
    51956 drwxr-xr-x 2 ashish ashish 4096 2005-10-30 22:33 .
    16161 drwxr-xr-x 53 ashish ashish 4096 2005-10-30 22:23 ..
    51958 lrwxrwxrwx 1 ashish ashish 8 2005-10-30 22:33 ash -> softlink
    51957 -rw-r--r-- 2 ashish ashish 13 2005-10-30 22:25 hardlink.file
    51959 -rw-r--r-- 1 ashish ashish 0 2005-10-30 22:30 softlink
    51957 -rw-r--r-- 2 ashish ashish 13 2005-10-30 22:25 ubu
    ashish@ash:~/test$

    Here ash is a link to file softlink. Both softlink and ash share a different inode number.

  3. #3
    That's good information. I always wondered why hard links couldn't span partitions, it's because hard linked files share the same inode number on the same partition.

    Softlinks are pointers. I thought they were both pointers.

    Thanks for the post!

Similar Threads

  1. Creation of FTP in RHEL5
    By ravi225 in forum Linux - General Topics
    Replies: 2
    Last Post: 06-24-2009, 12:27 PM
  2. File creation time - How to get?
    By OpenMinded in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 01-13-2007, 06:55 PM
  3. Web-based homepage creation software
    By trickster in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-29-2005, 07:03 PM
  4. Folder Creation
    By mulberrycrush in forum Windows - General Topics
    Replies: 11
    Last Post: 01-22-2005, 07:28 PM
  5. What's a symlink?
    By Steelysteel in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 06-09-2002, 05:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •