Q. Which of these commands will set the permissions on the file “myfile”: read and write for the owner(user), read for the group and nothing for others?
β
Correct Answer: (B)
$ chmod 640 myfile
Explanation: r = permission to read
w = permission to write
x = permission to run
– = 0 permission
With r=4 / w=2 / x=1
$ chmod 640 myfile
$ ls -l myfile
-rw-r----- 1 user1 user1 0 2018-10-29 21:41 myfile
w = permission to write
x = permission to run
– = 0 permission
With r=4 / w=2 / x=1
$ chmod 640 myfile
$ ls -l myfile
-rw-r----- 1 user1 user1 0 2018-10-29 21:41 myfile