There is something not clear on relationship between file properties and user and group.

root@debian:/home/debian# ls  -l  /home/linuxsir
total 4
-rw-r--r-- 1 linuxsir root 1549 Feb 23 19:16 test.txt

I draw a conclusion that the directory /home/linuxisir contain one file named test.txt, linuxsir is its owner ,and linuxsir belong to the root group.

root@debian:/home/debian# cat /etc/group

From cat /etc/group , linuxsir do not belong to group root?
How to think of this matter properly?

1 Answer 1


First of all, cat /etc/group only shows the groups created in the system. If you want to know which groups linuxsir belongs to, you need to use this command groups linuxsir.

The result of ls -lsays:

-rw-r--r-- 1 linuxsir root 1549 Feb 23 19:16 test.txt

It means:

  • user linuxsir is owner and can read and write on test.txt
  • group root can only read
  • Anyone else can only read

It doesn't say that group rootis owner of the file, it is only saying which permissions group roothas over the file.

By default, the owner of a file is the user who created it and the group assigned to a file is the primary group of the user. However, you can change the group of a file using chgrp.

  • In my situation, groups linuxsir linuxsir : linuxsir my_test_group1
    – showkey
    Feb 27, 2015 at 11:54
  • The User linuxsir only belongs to the groups linuxsir and my_test_group1. He isn't on the group root.
    – jcbermu
    Feb 27, 2015 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .