LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2015, 06:44 AM   #1
FilipN
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Rep: Reputation: Disabled
Kinds of links in Linux and use of unlink


Hello, I am learning about file types in Linux, and i see there are hard and symbolic links, also I saw that unlink function in C deletes a link to a file and decrements the intern link counter. The problem is that i don't understand what link is deleted when unlink is called. Is it the parents link to that file?
 
Old 04-18-2015, 08:15 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
A normal file has one hard link, a directory entry which points to the inode for the file. The inode keeps track of the number of hard links. When you unlink the last one, the file is gone. The link removed by unlink is the one that is passed to it when it is called.
 
Old 04-18-2015, 09:31 AM   #3
FilipN
LQ Newbie
 
Registered: Apr 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you very much. This made things clear.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what kinds of webcams will work in linux baronobeefdip Linux - Hardware 17 10-27-2009 03:26 PM
can i install two kinds of linux distribution ztdep Linux - Software 4 10-20-2006 06:59 AM
What kinds of linux should I select? Jason_zwf Red Hat 2 08-07-2004 10:09 AM
Three kinds of Linux users: an observation ptesone General 37 03-31-2004 12:53 PM
Differnt kinds of Linux satusred Linux - Software 6 11-02-2003 05:59 PM


All times are GMT -5. The time now is 09:00 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration