How can I check the permissions of a specific group?
I've a group on my system and I don't know which permission it has. Where can I find all group permissions?
I want to have an output like this:
folders owned by group 'test'
/home/test/Documents/
/home/test/Pictures/
/var/www/website/
var/www/python/ 5 Answers
You can see the rights of group by ls -l in terminal to see the permissions of corresponding files.
drwxrwxr-x 3 owner group 4096 Jun 23 17:15 Calibre Library
-rw-rw-r--. 1 owner group 44444 May 25 11:36 custom 1.tar.gz
drwxr-xr-x. 4 owner group 4096 Jul 11 21:26 Desktop
drwxr-xr-x. 2 owner group 4096 Jul 9 20:35 Documents
drwxr-xr-x. 13 owner group 12288 Jul 11 12:42 Downloads
drwx------. 7 owner group 4096 Jun 23 13:21 DropboxWhich can be further shown
You can refer to File Permissions for changing permissions. Whereas following commands are used to change it.
chmod - modify file access rights
su - temporarily become the superuser
chown - change file ownership
chgrp - change a file's group ownerEDIT : To view the files owned by the group "test" and user "luser' use FIND command
to find all the groups available on your system:
cat /etc/group |cut -d: -f1eg. for finding the groups that the current user belongs to
groups
luser test adm cdrom sudo dip plugdev lpadmin sambasharethen looking for groups luser belongs to
groups luser
luser : test luser adm cdrom sudo dip plugdev lpadmin sambashareNow to see the files owned by group "test" in particular path or folder. Try
find /home -group test
find /etc -group root
GUI method via Nautilus , select the Group, Permissions , Owner options from the Nautilus Preferences menu.
Then in Nautilus File manager , by selecting Icons views you will get the group name under icon as
And in list view you will get something like
Groups don't have permissions so to say...
Each file/folder is owned by a user and a group. If your group owns the file/folder then you'll have the permissions in the second group of permissions.
For example, let's say a file has:
-rwxrw-r--Split this into thirds, excluding the first character (this is a special character):
rwx(Owner) - The owner has read/write and execute permissions.rw-(Group) - The group has read and write permissions.r--(Everyone else) - Everyone else has read permissions.
You can change these permissions using chmod and you can change who owns them by using chown. To learn more about these commands, open a terminal and type man chmod or man chown.
Try:
find / -group name_of_group You would type in the following command:
find / -group test 2>/dev/nullSyntax description:
find = Find command
/ = from root Directory down
-group = search for a group where ...
test = ...group name equals 'test'
2 = Error Output ...
> = ...is redirected...
/dev/null = ...to device NULL (no Output) To see the permissions of all files and folders associated with the group test in the mentioned folders you can use
find /home/test/Documents /home/test/Pictures /var/www/website var/www/python -group test -printf %M -print-printf %Mwill output the permissions in the same formls-ldoes, not followed by a newline-printadds the filename followed by a newline.
Reference: man find.
To see the permissions of the mentioned folders you can use
ls -ld /home/test/Documents /home/test/Pictures /var/www/website var/www/python