LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-16-2016, 08:57 AM   #1
techie_san778
Member
 
Registered: Jul 2011
Posts: 90

Rep: Reputation: Disabled
Exclamation Query regarding directory links


Hello friends,

In the following output of ls -l in my home directory,
[san@Desktop ~]$ ls -la test1
total 16
drwxr-xr-x 2 san san 4096 Jun 14 00:01 .
drwx------ 25 san san 4096 Jun 13 21:13 ..
-rw-rw-r-- 1 san san 0 Jun 2 22:54 file2
-rw-rw-r-- 1 san san 0 Jun 14 00:01 .output
-rw-rw-r-- 1 san san 23 Jun 2 22:59 Text

What is the meaning of 25 (links) ? apart from itself, there are 24 directories that point to /home/san ? Please clarify me.

Last edited by techie_san778; 06-16-2016 at 10:55 AM.
 
Old 06-16-2016, 09:46 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 5,989
Blog Entries: 16

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
That number is the number of "hard links" to the file's inode. Every file has one hard link -- to its filename. A directory has at least two: one to the directory name and one to the file called "." inside the directory, so it can be accessed by either of these names. A directory with sub-directories will have an extra hard link to the ".." file in each of them.

The directory in your example must have 23 sub-directories in it. In general the number of hard links to a directory is 2n+2, where n is the number of subdirectories
 
  


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
[SOLVED] how to list files in directory or generate links for files in a directory darksaurian Programming 7 08-08-2015 02:28 PM
how can I gzip directory without following symbolic links tiroloz Linux - Newbie 1 04-27-2012 04:21 PM
removeing symbolic links - directory barnea10 Linux - Newbie 5 04-18-2011 05:18 PM
[SOLVED] /etc/rc.d Directory soft links Soji Antony Linux - Newbie 3 02-20-2011 02:36 AM
OpenLDAP query Active Directory noir911 Linux - Server 0 04-30-2008 07:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:06 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