LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2001, 12:13 AM   #1
Will
Member
 
Registered: Aug 2001
Posts: 73

Rep: Reputation: 15
Two quick questions.


Soft links / Hard links:

A soft link will create a link directly to the original file and a hard link creates a copy of the original file and updates them both if either one is updated.

So what exactly is the purpose in their difference?


Sticky:

Throught permissions and gui's you find the 'Sticky' word. What does it mean and how does it affect things?
 
Old 11-08-2001, 02:58 AM   #2
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
with a hard link, both files must be within the same partiton. here's some info on the sticky bit:
http://www.uwsg.iu.edu/UAU/files/sticky.html
 
Old 11-08-2001, 07:53 AM   #3
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
Re: Two quick questions.

Quote:
Originally posted by Will
Soft links / Hard links:

A soft link will create a link directly to the original file and a hard link creates a copy of the original file and updates them both if either one is updated.

So what exactly is the purpose in their difference?
A hard link actually point the same cluster on the hard drive as the original filename.
It doesn't make a copy of the file.
A soft link only make link to the file name.

When deleteing the soft link the file remains but when you delete a

You can also prevent or allow web page users on your server to follow symlinks.

run the command info ln to get more info.
 
Old 11-08-2001, 11:42 AM   #4
isajera
Senior Member
 
Registered: Jun 2001
Posts: 1,635

Rep: Reputation: 45
ummm.. it's a bit more complicated that just "if you delete this and that..."

in the hard drive inode table, every file has a list of the number of hardlinks set to it. if an existing file has a hard link added to it, then the link_count or whatever it's called is incremented. there are now two hard links to the same file. a hard link points to the spot on the harddrive where the file is. if the file is moved, then the hardlinks remain. both links are essentially exactly the same. if you delete one, the link_count is decremented. if the link_count is 0, then the file is deleted.

a softlink, by contrast, just points to the file name. it just says, don't look at this file, look at /usr/bin/something-else. if the actual file is moved, then the softlink is broken, and accessing it will give a file-not-found error.
 
Old 11-09-2001, 12:46 PM   #5
Will
Member
 
Registered: Aug 2001
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by isajera
[B]ummm.. it's a bit more complicated that just "if you delete this and that..."

in the hard drive inode table, every file has a list of the number of hardlinks set to it. if an existing file has a hard link added to it, then the link_count or whatever it's called is incremented. there are now two hard links to the same file. a hard link points to the spot on the harddrive where the file is.

Ok, I think I got that so far.


if the file is moved, then the hardlinks remain. both links are essentially exactly the same.

[B] So does that mean that if the file is moved the remaining hardlinks still get updated but not the original or does the updating stop if the original is moved.

if you delete one, the link_count is decremented. if the link_count is 0, then the file is deleted.

the 0 that would be the original file, right? or is the original file no longer really matter when it comes to hard links. ie; the original file can be deleted and the others still work.

I think some experimenting is in order
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
three quick questions... honda_ricer Linux - Newbie 9 11-30-2005 07:53 AM
Quick questions Nylex Slackware 4 09-21-2003 07:16 AM
quick questions yocompia Slackware 5 06-20-2003 04:34 PM
quick questions for rh 7.3 GT I.N.C Linux - Newbie 12 09-07-2002 02:51 AM
2 Quick Questions sonikntails Slackware 2 05-03-2002 04:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration