To show you in detail "who you are", you may use the command
uid=1000(alphawolf) gid=1000(alphawolf) groups=1000(alphawolf),4(adm),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),107(netdev),113(lpadmin),128(sambashare),132(wireshark),2000(humans-bc-aw)
As you see, depending on your account the output can get pretty long.
- It does not only display your user name and ID "
- but also the name and ID of your primary group "
and names and IDs of all other groups your account is a member of. This list by default only contains the primary group if you're a normal/restricted user, and a longer list containing at least
sudo if you're an admin user.
Now, how can we determine our permissions on a file with this information?
We take the output of
ls -l /path/to/file-or-directory, like for example:
$ ls -l /usr/bin/dumpcap
-rwxr-xr-- 1 root wireshark 85632 Aug 16 01:43 /usr/bin/dumpcap*
This file is an executable used by Wireshark to capture network packages with elevated privileges. I chose it because of the different owner and group permissions.
Let's look at the important details:
This is the user owning the file.
This is the user group this file is assigned to.
Those are the file permissions for the user, the group members and all others, as described below:
- rwx r-x r--
| \ / \ / \ /
| V V V
| | | \__ Other permissions: [r] 'r'ead access granted
| | | [-] 'w'rite access denied
| | | [-] e'x'ecuting denied
| | \__ Group permissions: [r] 'r'ead access granted
| | [-] 'w'rite access denied
| | [x] e'x'ecuting granted
| \__ Owner permissions: [r] 'r'ead access granted
| [w] 'w'rite access granted
| [x] e'x'ecuting granted
\__ File type: [-] normal file
(alternatives: 'd'irectory, sym'l'ink,
'c'haracter device, 'b'lock device, ...)
Now, what could my user
alphawolf with the
id output above do with this file?
- I am not the user
root who has full
write and e
- But I am a member of the
wireshark group, therefore I have the permissions set for the file's group: I may
read the file and e
xecute it, but not modify it (no
- Others could only
read the file, but neither
write to it nor e
This will help you to determine you permissions on different system files.