Welcome To Golang By Example

What does chmod o-w command mean in bash or terminal

Overview

There are three components that are in the picture when it comes to managing the permissions of a file. 

Permission Groups

Permission Types

Operations Definitions

So o-w means taking away write permission from the other user

Before we see an example let’s see how file permissions are represented when you run ls command

Below are some points about the above diagram

Example

ls -all | grep temp.txt
-rw-r--r--    1 root  root      0 Aug  9 14:50 temp.txt

Notice that the other user only has permission to only read

chmod o+w temp.txt
ls -all | grep temp.txt
-rw-r--rw-    1 root  root      0 Aug  9 14:50 temp.txt

See output above. Execute permission is also given to the other user.

chmod o-w temp.txt
ls -all | grep temp.txt
-rw-r--r--    1 root  root      0 Aug  9 14:50 temp.txt

Notice how write permission is taken away from the other user