9

There is root ownership and root group applied to /media/pandya/Ext4/* ("pandya" is user-name). To apply group "pandya" I run following command:

 sudo chown -hR root:pandya /media/pandya/Ext4/*

Now, There is root ownership and "pandya" group applied to /media/pandya/Ext4 and all sub files and directories.

But group "pandya" has only permission "Access files" (for directories) and "Read Files" (for files) for all sub directories and files.

So, How to apply full permissions ("create and delete files" to directories and "read and write" to files) to group "pandya" ? So-that I can fully access /media/pandya/Ext4/ and all sub directories and folders with "pandya" group.

1
  • I changed your edit. You don't want to blindly make all files executable. To give write access, just use chmod g+w. To make all subfolders accessible, you will need to add the executable bit to them but you cna do so (for directories only) using find /media/pandya/Ext4/ -type d -exec chmod g+x {} +.
    – terdon
    Apr 26, 2014 at 12:53

2 Answers 2

9

The chown command is to change user and group ownership, to change permissions, you need chmod. So, once you have set the group ownership to pandya using chown as you have, change the permissions to give the group write access:

chmod -R g+w /media/pandya/Ext4/

From man chmod:

The format of a symbolic mode is [ugoa...][[+-=][perms...]...], where perms is either zero or more letters from the set rwxXst, or a single letter from the set ugo. Multiple symbolic modes can be given, separated by commas.

A combination of the letters ugoa controls which users' access to the file will be changed: the user who owns it (u), other users in the file's group (g), other users not in the file's group (o), or all users (a). If none of these are given, the effect is as if a were given, but bits that are set in the umask are not affected.

The operator + causes the selected file mode bits to be added to the existing file mode bits of each file; - causes them to be removed; and = causes them to be added and causes unmentioned bits to be removed

-R, --recursive

change files and directories recursively

So, g+w means "give users that belong to the file's group write access" and -R means apply to all files and subdirectories recursively.

0

Use:

sudo chown -hR pandya:pandya /media/pandya/Ext4/

For more information, run man chown in terminal for the man file.


EDIT: By the way, you don't need the * at the end since you're doing it recursively.

2
  • Can Permission to Group pandya not be changed?
    – Pandya
    Apr 26, 2014 at 7:58
  • That does not affect the permissions. Presumably the OP wants the files to be owned by root.
    – terdon
    Apr 26, 2014 at 11:28

You must log in to answer this question.

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