Skip to content

What does the linux command chmod go+r do?

Published:

I a saw this command on stackoverflow. It was one auf this answer you see, try and then everything works and you don’t know why. In my case I used this command on a linux machine on a backup file i wanted to restore. I know that chmod +x makes files executables on linux, but i did not know why i had to write +x after the chmod command and what’s the difference to chmod go+r.

The chmod tool: This tool or command is used to set access rights of users for files on linux.

The “go”: There are three differnt types of linux users. The go is just a combination of the of the letters for these groups. Here is a overview of the letters

u – user (file or directory owner, creator)
g – group (the group to which the file or directory belongs)
o – other (other than user and group)
a – all (user, group, other) (all, anyone can access files and directories.)

For every file on the system for every user there are three types of access right to a file.

r – Read permission: read a file and list all files in a directoy
w – Write permission: you can create, change or delete a file with this permission
x – Execute permission: with this permission you can run a file and execute programs

When you are inside a directory on a linux machine you can view all these permissions with the command ls -all

There are three different operators for the chmod command:

– : remove chmod permission.
+ : add chmod permission.
= : set chmod permission.

So as final result – what exactly does chmod go+r do? For the group and other users of the file (go) it adds a permission (+) to read this file (r).