Intro To 'groups' Command In Linux
2023-05-25 - By Robert Elder
I use the 'groups' command to list all of the groups that a user belongs to:
groups
robert adm dialout cdrom sudo dip plugdev lpadmin lxd sambashare
By default, the group memberships that are shown are for the current user. You can explicitly specify a user to see group memberships for that user as well:
groups postgres
postgres : postgres ssl-cert
The set of groups that a user belongs to will determine if that user has the ability to access certain files or system resources.
The permission settings related to groups can be seen using the 'ls -l' command. Here is an example that shows the group permissons on some interesting files:
ls -l /dev/{input/event0,tty} /etc/shadow some-file.txt
the group permissions are highlighted here:
and the group ownerships are highlighted here.
And that's why the 'groups' command is my favourite Linux command.
Intro To 'stty' Command In Linux
Published 2023-10-04 |
$1.00 CAD |
Intro To 'nproc' Command In Linux
Published 2023-07-15 |
Intro To 'comm' Command In Linux
Published 2023-09-06 |
How To Force The 'true' Command To Return 'false'
Published 2023-07-09 |
A Surprisingly Common Mistake Involving Wildcards & The Find Command
Published 2020-01-21 |
A Guide to Recording 660FPS Video On A $6 Raspberry Pi Camera
Published 2019-08-01 |
Intro To 'chroot' Command In Linux
Published 2023-06-23 |
Join My Mailing List Privacy Policy |
Why Bother Subscribing?
|