GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Operating System  >  UNIX
Go To First  |  Previous Question  |  
 UNIX  |  Question 57 of 57    Print  
Hard link and Soft link
What is the difference between hard link and soft link?


  
Total Answers and Comments: 2 Last Update: November 29, 2008     Asked by: rahul1st 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: jmagill
 
The data part of a file is associated with something called an 'inode'. When more than one filename references 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 'symbolic link' or a 'soft link'.

Above answer was rated as good by the following members:
Rambo188
August 21, 2008 10:24:24   #1  
jmagill Member Since: August 2008   Contribution: 1    

RE: Hard link and Soft link
The data part of a file is associated with something called an 'inode'. When more than one filename references 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 'symbolic link' or a 'soft link'.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 28, 2008 23:57:39   #2  
BijaylaxmiMohapatra Member Since: November 2008   Contribution: 2    

RE: Hard link and Soft link
Hard Link
when a file is copied, both the original and copy occupy separate space on the disk.
unix allows a file to have more than one name and yet maintain a single copy on the disk. The file is then said to have more than one link or name, but all have the same inode number. This is called hard link. All attributes are identical any modification or change in one file is automatically available in the linked file. It provides some protection against accidental deletion. Let there be a file named restore.sh. You need to create another file which provides as backup to the original file. By creating a link, you create a backup.
unix command used to create hard link >>ln- backup.sh restore.sh

Soft Link
It doesn't have the file's content but simply provids pathname of that automatically has the contents. This is called as softlink. but incase the original file is deleted we can't get the file's content from the linked file, coz, it just provides the path name of the file. This is also known as symbolic link. Windows shortcuts are more like symbolic links. The original file and the linked files have different inode nos.
Unix command used to create soft link>>ln-s

 
Is this answer useful? Yes | No

 Related Questions

IBM-AIX Interview Questions:1. Why is the . not included in the path? 2. How will you mirror a volume and how will you find if a volume is mirrored ? lsvg –l (vol gp name) 3. A system is echoing the ping but not able to login via telnet why ? Etc /services etc/inetd.conf 4. what is the migration path from 4.3 to 5.1 ? (or any versions) 5. A system is able to ping within the network but not outside why ? 6. What are the components of a HACMP ? (did you use serial interface) 7.

What is the difference between hard link and soft link? 
Latest Answer : Hard Linkwhen a file is copied, both the original and copy occupy separate space on the disk.unix allows a file to have more than one name and yet maintain a single copy on the disk. The file is then said to have more than one link or name, but all have ...
Read Answers (2) | Asked by : rahul1st


 Sponsored Links

 
Related Articles

High Level Data Link Control (HDLC)

High Level Data Link Control HDLC The High Level Data Link Control protocol was developed by the International Organization for Standardization ISO It is used for switched and non switched networks and is a bit oriented architecture The High Level Data Link Control has been accepted and used widel
 

Synchronous Data Link Control (SDLC)

Synchronous Data Link Control SDLC The SDLC or the Synchronous Data Link Control was first developed by IBM It is basically a linked layer protocol which can be used with systems network architecture or the SNA environment In this system all the functions in a network can be defined and slotted into
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

System Implementation

In the previous articles relating to SDLC Stages we discussed about Project Planning and Feasibility Study moved on to System Analysis and Requirements which lead to Systems Design. Systems Design will naturally lead to another stage where it becomes closer to the actual deployment of the p
 

System Analysis and Requirements

In the previous chapter, we’ve discussed about project planning and feasibility study. That stage was important because it tries to establish a problem in our highly technological world. As our understanding on what we can do in computers evolve and so are the things that we need to make t
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Operating Systems and IT Certification

With the burst of information technology that is becoming a part of the dominant culture throughout the world, are programs that are designed to help those in this area to grow in knowledge.  By understanding the different technologies that are available, one is able to use them and impleme
 

Unix Client Server Technology

Unix Client Server Technology Understanding the Role of Unix When discussing client server technology it is important to understand UNIX one of the first primary building blocks for network possibilities that continues its influence today UNIX is an operating system designed for multi tasking by mul
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape