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?

  • (A) $ chmod 046 myfile
  • (B) $ chmod 640 myfile
  • (C) $ chmod 310 myfile
  • (D) $ chmod rw rw myfile
πŸ’¬ Discuss
βœ… 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
Explanation by: Sandeep
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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
213
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Sandeep
Publisher
πŸ“ˆ
81%
Success Rate