Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The bits 750 invoke the -rwxr-x--- permissions, on a given file, to the user who owns the file and "the" group. My query regards the group. Which group on the system would receive these permissions?

Am I right in assuming that they would be awarded to the group that the owner belongs to? If so, is this always the case?

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

Am I right in assuming that they would be awarded to the group that the owner belongs to? Wrong. A file can belong to any user and any group. There is no relationship between user and group in such way.

Every file has user owner and group owner. These are separate entities. If you do ls -l it will show you owner user and owner group of every file, e.g.:

$ ls -l
-rw-r--r--  1 user_owner group_owner   22K May  2 13:06 file.png
-rw-r--r--  1 user_owner group_owner   22K May  2 13:12 file.jpg

To change user owner, you use chown command. To change group owner, you use chgrp command.

You can also use chown and specify both, user and a group, by separating them with colon like this:

$ chown user:group file
share|improve this answer
    
Simple and short. Thank you. –  adampski May 8 at 13:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.