Miscellaneous
  Home arrow Miscellaneous arrow Page 3 - In Detail: UNIX File Systems
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

In Detail: UNIX File Systems
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2009-04-01

    Table of Contents:
  • In Detail: UNIX File Systems
  • Mounting file systems
  • Links in UNIX
  • The standard files and directions
  • File names on the shell command line

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    In Detail: UNIX File Systems - Links in UNIX


    (Page 3 of 5 )

     

    There are two types of links in UNIX: symbolic and hard. This can make it easier to work with files as we are creating new names for them and shortcuts to certain files. A hard link means that we're giving another name to the file. The two names have the same value. In this case, if we delete one of them, the file remains, regardless of which one was created first. 

    We can delete a file/directory only after we have deleted all of its hard links. When we create a link, we just give another name to the file. If we delete either of its names, the other will be still valid. You can create this type of link only within the same partition. 

    Symbolic links, on the other hand, are just pointers to the file. If we delete the original file, the link will remain and point nowhere. We can create any number of links. There are no restrictions. Symbolic links can point across partitions. We use the ln command to create links.

    The syntax of the command looks as follows: 

    ln [what file/directory] [what new name/link]

    By default, the links are hard. If we want to create a symbolic link we need to add the -s option. For example, in the following lines, I will create a symbolic and a hard link to the alfa file. 

    ln alfa beta

    ln -s alfa omega

    Notice in the example below that the two hard links have the same i-node numbers, meaning they are exactly the same file under different names. The ls command also echoes back symbolic links, as you can see. These will display in a different color when they are invalid. Also, observe the same i-node numbers for alfa and beta in the image below:

     

    More Miscellaneous Articles
    More By Gabor Bernat


     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek