LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ls output interpretation (https://www.linuxquestions.org/questions/linux-newbie-8/ls-output-interpretation-907297/)

JJJCR 10-09-2011 05:46 PM

ls output interpretation
 
hi guys, need your help to understand the ls output command


drwxr-xr-x 2 root root 4096 oct 9 2011 xml

d - directory
rwxr - permission for the owner
xr - permission for the group
x - permission for others

2 = means what?

root = name of the user

4096 = means what? is this a process id or what?

thanks.

unSpawn 10-09-2011 05:58 PM

2 - links, 4096 - I/O block size. Also see 'stat xml' output.

grail 10-09-2011 06:39 PM

I am pretty sure that if you use your exact words in google, ie ls output interpretation, at least one of the 4+million replies must have this information.
I would add that some of the information you provided is actually incorrect.

Tinkster 10-09-2011 11:57 PM

Quote:

Originally Posted by JJJCR (Post 4494098)
rwxr - permission for the owner
xr - permission for the group
x - permission for others

Not quite ...

The perms come in triples
Code:

d                  directory
 rwx              owner
    r-x            group
      r-x        other


Cheers,
Tink

JJJCR 10-10-2011 02:17 AM

Quote:

Originally Posted by Tinkster (Post 4494265)
Not quite ...

The perms come in triples
Code:

d                  directory
 rwx              owner
    r-x            group
      r-x        other


Cheers,
Tink

Thanks Tink :)

sj1981 08-20-2019 04:59 AM

Quote:

Originally Posted by grail (Post 4494125)
I am pretty sure that if you use your exact words in google, ie ls output interpretation, at least one of the 4+million replies must have this information.
I would add that some of the information you provided is actually incorrect.

Ironically this post is the first result google shows when you do the exact search

ehartman 08-20-2019 06:19 AM

Quote:

Originally Posted by JJJCR (Post 4494098)
drwxr-xr-x 2 root root 4096 oct 9 2011 xml

d - directory
rwxr - permission for the owner
xr - permission for the group
x - permission for others

No, rwx (read/write/search) for the owner
r-x for the group (NO write permission)
r-x for "others" (non-owner nor in the group, which will be most users in this case)
These are 3 groups of 3 permission letters, - means NOT allowed

2 link count, you can forget about that (it will always be 2 + the number of SUBdirectories for a directory)
root root owner (not user) and group of this directory (cq file)
4096 current size of the file this directory IS.
In an ext? fs a directory will always be a multiple of the block size, that is:
mkdir allocates a full block and every extension will be allocated that too.
In other FS'es this may be different.
BTW: directories in ext? will never shrink, so a directory of, say, 16KB with only a single entry IN it is possible, if it used to contain more filenames.

Jan K. 08-20-2019 07:03 AM

ehartman, you *could* have posted that answer eight years ago! :D

ehartman 08-20-2019 09:25 AM

Quote:

Originally Posted by Jan K. (Post 6027229)
ehartman, you *could* have posted that answer eight years ago! :D

Yes, If I had been posting then AND seen this thread. But then I still was working so didn't have much time to post, I only sometimes looked here specificcally for problems I got then IN my job.
Now I'm retired I've got much more time to read/post (and have got a few years more experience in several Linux distro's too). So now I just look at a lot of the new postings (and someone did post a new msg in this thread).

pan64 08-20-2019 09:32 AM

not really, it was already explained several times, even here:

https://www.linuxquestions.org/quest...anyone-933845/
https://unix.stackexchange.com/quest...al-output-mean
https://www.garron.me/en/go2linux/ls...rmissions.html

Jan K. 08-20-2019 10:45 AM

Quote:

Originally Posted by ehartman (Post 6027281)
Yes, If I had been posting then AND seen this thread. But then I still was working so didn't have much time to post, I only sometimes looked here specificcally for problems I got then IN my job.
Now I'm retired I've got much more time to read/post (and have got a few years more experience in several Linux distro's too). So now I just look at a lot of the new postings (and someone did post a new msg in this thread).

My favorite threads are the ones marked [Solved], but in this one I suddenly wondered why I was reading eight years old posts? And sure enough... a necro thread awaken by a first time poster...

Bet you didn't notice either, so fell for the urge to pull your leg! :D

Btw. like your posts a lot. Always very informative and helpful! :hattip:


All times are GMT -5. The time now is 04:38 PM.