LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-20-2011, 09:42 AM   #1
jacquestechie
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Rep: Reputation: 0
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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 09-20-2011, 09:55 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
The number of directory entries that refer to the file.

Kind regards
 
Old 09-20-2011, 09:59 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,504

Rep: Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992
Quote:
Originally Posted by jacquestechie View Post
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
 
2 members found this post helpful.
Old 09-20-2011, 01:03 PM   #4
mmrtnt
LQ Newbie
 
Registered: Nov 2006
Location: las vegas, nevada
Distribution: fedora core x
Posts: 25

Rep: Reputation: 8
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.
 
2 members found this post helpful.
Old 09-21-2011, 03:28 AM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
The digit 3 shows the number of links to the file. In your case there are total 3 links to the file.
 
Old 09-21-2011, 07:47 AM   #6
jacquestechie
LQ Newbie
 
Registered: Jun 2007
Posts: 9

Original Poster
Rep: Reputation: 0
cld u pls give me the internet link to read more.
 
0 members found this post helpful.
Old 09-21-2011, 08:06 AM   #7
jason_not
Member
 
Registered: Aug 2010
Location: Beaverton, Oregon, USA
Distribution: Pfsense, Ubuntu, Centos, Fedora, Redhat, Scientfic, MacOS
Posts: 76

Rep: Reputation: 19
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
 
Old 09-21-2011, 08:07 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Quote:
Originally Posted by jacquestechie View Post
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.
 
2 members found this post helpful.
Old 09-21-2011, 09:22 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,504

Rep: Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992Reputation: 3992
Quote:
Originally Posted by jacquestechie View Post
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?
 
  


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
Reading ext3 file system on Mac and overriding file permission moravveji Other *NIX 6 09-12-2011 02:25 AM
[SOLVED] Read a number x from a file and write a character in the xth column of other file homexylo Programming 7 08-05-2011 05:28 AM
Identify and explain the major number, minor number, and revision number in Linux... turbomen Linux - Newbie 1 11-16-2010 02:48 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 09:57 AM
how to delete last number/word of a file and incude file count at the end of the chennaiguy Linux - Newbie 2 02-18-2008 09:08 PM


All times are GMT -5. The time now is 08:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration