Change group access to directory and all sub directories and files

Pandya

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.

terdon

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

From Dev

Git: ignore files but not sub-directories in a directory

From Dev

How to access all files in all sub directories using shell script?

From Dev

assigning files in a directory to sub-directories

From Dev

Python 2.7 How to list files in a directory AND all sub directories?

From Dev

Delete all files and sub directories but keep main directory

From Dev

How to delete all files in a directory, keeping sub-directories intact

From Dev

Batch command for ImageMagick to convert all files in a directory and sub-directories on windows

From Dev

Error when uploading a directory to Dropbox including all files and sub-directories with Dropbox Python API

From Dev

Renaming all files within different sub directories

From Dev

find all files indirectory and sub-directories and provide the path from directory

From Dev

Change group access to directory and all sub directories and files

From Dev

Command Line loop to run command on all files in a directory (plus sub directories, if possible

From Dev

Print a list of "full" relative paths of all the files present in a directory and in its sub-directories

From Dev

How can i add a recursive loop to delete a directory with all sub directories and files inside?

From Dev

How to append a date to all files in a directory without touching sub-directories via bash script

From Dev

list all c files in sub directories and their parent directory

From Dev

How to move all files (excluding sub-directories) from one directory to another?

From Dev

How to split a directory of files into sub-directories

From Dev

find matching files in one directory and sub directories

From Dev

Apache Alias For External Directory And All Sub Directories

From Dev

Error when uploading a directory to Dropbox including all files and sub-directories with Dropbox Python API

From Dev

How do I change the ownership of files within current directory, sub-directories, and sub-directories of sub-directories?

From Dev

zip files within all sub-directories of a given parent directory

From Dev

Rename multiple files in sub directories to their directory names

From Dev

Bash ~ Access directory that may change, from script within sub-directories of directory

From Dev

Listing all files in a directory and sub-directories C#

From Dev

PHP Delete all files that are empty in a Directory and any sub directories

From Dev

Setup a cron job to archive a directory and all its sub-directories including hidden files using tar

Related Related

  1. 1

    How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

  2. 2

    Git: ignore files but not sub-directories in a directory

  3. 3

    How to access all files in all sub directories using shell script?

  4. 4

    assigning files in a directory to sub-directories

  5. 5

    Python 2.7 How to list files in a directory AND all sub directories?

  6. 6

    Delete all files and sub directories but keep main directory

  7. 7

    How to delete all files in a directory, keeping sub-directories intact

  8. 8

    Batch command for ImageMagick to convert all files in a directory and sub-directories on windows

  9. 9

    Error when uploading a directory to Dropbox including all files and sub-directories with Dropbox Python API

  10. 10

    Renaming all files within different sub directories

  11. 11

    find all files indirectory and sub-directories and provide the path from directory

  12. 12

    Change group access to directory and all sub directories and files

  13. 13

    Command Line loop to run command on all files in a directory (plus sub directories, if possible

  14. 14

    Print a list of "full" relative paths of all the files present in a directory and in its sub-directories

  15. 15

    How can i add a recursive loop to delete a directory with all sub directories and files inside?

  16. 16

    How to append a date to all files in a directory without touching sub-directories via bash script

  17. 17

    list all c files in sub directories and their parent directory

  18. 18

    How to move all files (excluding sub-directories) from one directory to another?

  19. 19

    How to split a directory of files into sub-directories

  20. 20

    find matching files in one directory and sub directories

  21. 21

    Apache Alias For External Directory And All Sub Directories

  22. 22

    Error when uploading a directory to Dropbox including all files and sub-directories with Dropbox Python API

  23. 23

    How do I change the ownership of files within current directory, sub-directories, and sub-directories of sub-directories?

  24. 24

    zip files within all sub-directories of a given parent directory

  25. 25

    Rename multiple files in sub directories to their directory names

  26. 26

    Bash ~ Access directory that may change, from script within sub-directories of directory

  27. 27

    Listing all files in a directory and sub-directories C#

  28. 28

    PHP Delete all files that are empty in a Directory and any sub directories

  29. 29

    Setup a cron job to archive a directory and all its sub-directories including hidden files using tar

HotTag

Archive