Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple explanation about ls -l

Status
Not open for further replies.

hokky

Technical User
Nov 9, 2006
170
AU
Hi guys,

I've got the list of file like this below :
Code:
-rwxr-xr-x  [b]1[/b] hokky [b]market[/b] 1018205 Jun 21  2006 fluxbox-1.0rc.tar.gz*

can some one tell me what 1 means ?

And about market ? is that the owner's group ?

Thanks guys
 
This column indicates the hiearchy level under this objet.

A simple file has 1
a direcrory with just another derectory behind will had 2 and so on.


Market is as you said, the goup wich own that object
 
Hokky,

In your example the 1 represents the link count. If you created a hard link to this file the number would show as 2.
It is an association between the file and inode numbers that is called the link count.

man ln for a better explanantion.

Alan

 
By example

touch filename
ls -al filename

-rw-r--r-- 1 auser asystem 0 22 Feb 11:08 filename

ln filename filename.new
ls -al filename

-rw-r--r-- 2 auser asystem 0 22 Feb 11:08 filename

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Code:
-rwxr-xr-x

User:   - not a directory
        r read
        w write
        x execute

group:  r read
        - no write
        x execute

world:  r read
        - no write
        x execute

hokky:  user the file belongs to

market: group the file belongs to, a user may be in several
        groups, but files generally belong to only one 
        group.  A user can only have one group active at a
        time.  The default group for a new file is the group
        that the active group of the user who created the 
        file, at the time the file was created.

I1018205 size
Jun 21   month day
2006     year

fluxbox-1.0rc.tar.gz* filename, star is added by your
                      version of ls, not standard, and I
                      believe it means that you have execute
                      permission to the file.
Why you have a group named market, I don't know.
see also the man pages for group and newgroup.

[plug=shameless]
[/plug]
 
Thanks guys for explanation,

But the thing is I checked whether which group that I belong, I tried :

Code:
$grep market /etc/group
market:x:360:ria

$grep hokky /etc/group
$

$grep hokky /etc/passwd
hokky:x:34825:360:hokky hokky:/home/hokky:/bin/bash

See, from the testing above,

I know that I belong to group id 360
But if I checked in market group only got ria,
and I don't exist in /etc/group

Is that possible in /etc/group they can miss some name ?

Thanks guys,
 
hokky:x:34825:360:hokky hokky:/home/hokky:/bin/bash
you're member of group 360

market:x:360:ria
Only ria is allowed to run newgrp 360 without providing the group password.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Do you know how to change my logon group into another group ?
I mean do I need root access of doing it ?

Thanks man
 
do I need root access of doing it
You must have write permission to /etc/passwd
The usual way is to ask the sysadmin ;-)


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top