LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-24-2013, 03:05 AM   #1
vaibhavs17
Member
 
Registered: Mar 2009
Posts: 51

Rep: Reputation: 1
ls -lrt interpretation drwxrwx--- 3 600 was 16384 May 24


Hi Team,

Can you please help me to understand what is below number 600 represents here?

[vaibhavs@za-pr-ap-fcat1]>ls -lrt
total 32
drwxrwx--- 3 600 was 16384 May 24 10:02 statements

[vaibhavs@za-pr-ap-fcat1]>finger 600
finger: 600: no such user.
[vaibhavs@za-pr-ap-fcat1]>

[vaibhavs@za-pr-ap-fcat1]>id 600
3004-820 User not found in /etc/passwd file
[vaibhavs@za-pr-ap-fcat1]>

[vaibhavs@za-pr-ap-fcat1]>id
uid=281(vaibhavs) gid=1(staff) groups=500(was),10400(cdadmin)
[vaibhavs@za-pr-ap-fcat1]>

Can somebody please help me to understand what 600 is representing here?
 
Old 05-24-2013, 03:15 AM   #2
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
600 is the uid, but that specific uid isn't associated with a real user on your machine. Users and groups are represented by numbers, the name is just there to make it easy for us humans.

This can happen when, for example, you untar an archive that was made on another linux/unix box.

EDIT: Have a look here: Introduction to System Administration (especially 6.3.1.1)

Last edited by druuna; 05-24-2013 at 03:24 AM.
 
Old 05-24-2013, 03:35 AM   #3
vaibhavs17
Member
 
Registered: Mar 2009
Posts: 51

Original Poster
Rep: Reputation: 1
thanks for quick reply... what is the difference between user and uid of particular directory?

[vaibhavs@za-pr-ap-fcat1]>ls -lrt
total 32
drwxrwx--- 3 600 was 16384 May 24 12:02 statements

[vaibhavs@za-pr-ap-fcat1]>ls -lrt
total 32
drwxrwx--- 3 vaibhavs was 16384 May 24 12:03 statements
 
Old 05-24-2013, 03:39 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
As druuna pointed, it's a numeric uid which is not associated with any user. However, you can check it in /etc/passwd file, if entry still exits:
Code:
~$ grep 600 /etc/passwd
There is a possibility that the user associated with this uid has removed and he was owner of the file "statements", so instead of showing the owner name in ls -lrt output, it's showing his numeric uid only.

For more details on file permissions, read file permissions tutorial.
 
Old 05-24-2013, 03:45 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by vaibhavs17 View Post
what is the difference between user and uid of particular directory?
Whenever a user account is created, a numeric uid gets assigned to him by system itself. On the other hand, directory do not has any uid, but they have an owner (some user) and a main group assigned to them.

In your case, 600 is uid of the owner of the "statement" directory and "was" is its main group.

As said above, 600 is nothing but uid (user identification number) of the owner of the directory. And perhaps the user has been deleted, so command is showing you only numeric uid, not the username i.e. owner name.
 
Old 05-24-2013, 03:55 AM   #6
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 shivaa View Post
On the other hand, directory do not has any uid, but they have an owner (some user) and a main group assigned to them.
Directories _do_ have a uid and gid!!
Code:
$ stat Movie/
  File: `Movie/'
  Size: 28672           Blocks: 56         IO Block: 4096   directory
Device: fe0ah/65034d    Inode: 35389443    Links: 2
Access: (0700/drwx------)  Uid: ( 1000/  druuna)   Gid: (10000/      jd)
Access: 2013-05-16 21:09:15.700514485 +0200
Modify: 2013-05-15 10:39:08.076007416 +0200
Change: 2013-05-15 10:39:08.076007416 +0200
Seen from unix/linux filesystem point of view a file and directory are the same thing (objects on a disk associated with one or more inodes).

@vaibhavs17: You can always change the owner/group of a file directory if you wish to do so using the chown/chgrp command.
Code:
$ chown vaibhavs statements
You probably need root privileges to do this.

Last edited by druuna; 05-24-2013 at 03:57 AM.
 
Old 05-24-2013, 04:55 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by druuna View Post
Directories _do_ have a uid and gid!!
Code:
$ stat Movie/
  File: `Movie/'
  Size: 28672           Blocks: 56         IO Block: 4096   directory
Device: fe0ah/65034d    Inode: 35389443    Links: 2
Access: (0700/drwx------)  Uid: ( 1000/  druuna)   Gid: (10000/      jd)
Access: 2013-05-16 21:09:15.700514485 +0200
Modify: 2013-05-15 10:39:08.076007416 +0200
Change: 2013-05-15 10:39:08.076007416 +0200
It's uid of the owner of the file "movie" i.e. 1000 is druuna's uid, not for file itself.
 
Old 05-24-2013, 05:27 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 shivaa View Post
It's uid of the owner of the file "movie" i.e. 1000 is druuna's uid, not for file itself.
Yes, for the file/directory itself!

Owner and group are represented by numbers and all files (dirs, special files etc) are associated with a uid/gid number and not a human readable name.

The uid/gid number is "fixed" and belongs to that file/directory. Only on my 3 boxes this uid translates to druuna, it will not on your box. If no match for this uid can be made, the number itself is shown (as is the case for the OP) and if a match is made some other user name will be shown.

A practical example would be tar. When tarring files/directories these are stored in the archive with the associated uid/gid (not the name), when you untar this file on a box that does not have an association with this uid/gid (in /etc/passwd and/or /etc/group) it will show the number.

So files and directories _do_ have uid's and gid's!
 
Old 05-24-2013, 06:15 AM   #9
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Alright, thanks a lot for this explaination, druuna!
 
  


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
/etc/group interpretation mitusf Slackware 13 10-18-2012 05:53 AM
[SOLVED] SIMH diesn't compile "undefinied reference to [fmod|clock_getres" although -lrt/-lm thosch97 Linux - Software 2 10-16-2011 05:19 AM
[SOLVED] ls output interpretation JJJCR Linux - Newbie 4 10-10-2011 02:17 AM
netstat interpretation twlilinux Linux - Server 6 06-17-2008 04:59 PM
dvbmwput(): MC_MOREDATA above threshold. 16384 bytes discarded samble Linux - General 3 04-07-2004 10:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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