LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File permission - Please tell me for what this number stands (https://www.linuxquestions.org/questions/linux-newbie-8/file-permission-please-tell-me-for-what-this-number-stands-904019/)

jacquestechie 09-20-2011 09:42 AM

File permission - Please tell me for what this number stands
 
I did ls -l in present working directory and found the below resule. I could not understand that 3 (makred with red color)stands for what. I searched over google and red many books, but i could not get relevant information.

root@locathost#:ls -l
total 17
drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir

repo 09-20-2011 09:55 AM

The number of directory entries that refer to the file.

Kind regards

TB0ne 09-20-2011 09:59 AM

Quote:

Originally Posted by jacquestechie (Post 4477205)
I did ls -l in present working directory and found the below resule. I could not understand that 3 (makred with red color)stands for what. I searched over google and red many books, but i could not get relevant information.

root@locathost#:ls -l
total 17
drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir

Really?? I put in "linux ls-l output explained" into Google, and the first hit gave me the answer. Any basic Linux books would also have it.
http://www.go2linux.org/command-ls-file-permissions

mmrtnt 09-20-2011 01:03 PM

From the "info coreutils 'ls invocation'" command on Fedora 14:

Code:

`-l'

`--format=long'
`--format=verbose'
    In addition to the name of each file, print the file type, file
    mode bits, number of hard links, owner name, group name, size, and
    timestamp (*note Formatting file timestamps::), normally the
    modification time.  Print question marks for information that
    cannot be determined.


Satyaveer Arya 09-21-2011 03:28 AM

The digit 3 shows the number of links to the file. In your case there are total 3 links to the file.

jacquestechie 09-21-2011 07:47 AM

cld u pls give me the internet link to read more.

jason_not 09-21-2011 08:06 AM

Hello,

You should start with the knowledge that what you see in directory entries are links themselves: not the actual files. Similar to looking up a book in the library: you get a record of where the book is, not the book itself.

Thus with:

drwxr-xr-x 3 nana writers 80 2005-09-20 21:37 dir

For a directory on the filesystem with no sub directories, this number will be 2, and the links themselves are:

dir <- this is the directory entry you are currently looking at. This link exists in the directory "enclosing" the dir entry.
dir/. <-this is its link to itself, you will see in the output of ls -la

The 3 tells me there is a subdirectory, where the following will be relevent:

dir/<some subdir>/.. <- The dir directory probably has another directory in it.

--jason

druuna 09-21-2011 08:07 AM

Quote:

Originally Posted by jacquestechie (Post 4478110)
cld u pls give me the internet link to read more.

You have to be kidding me! Have you read post #3 and did you click on the given link???

BTW: Use full words and sentences when communicating here. Sms/twitter text messages are not appreciated, hard to read and simply annoying.

TB0ne 09-21-2011 09:22 AM

Quote:

Originally Posted by jacquestechie (Post 4478110)
cld u pls give me the internet link to read more.

Spell your words out. And you WERE given the link, did you not read it?


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