Computer Science - Unix - Discussion

Discussion :: Unix - Section 2 (Q.No.16)

16. 

Which of the following commands is used to absolutely assign all permissions to the owner, read and write permissions to the group and only executable permission to the others of the file note?

[A]. chmod 761 note
[B]. chmod 671 note
[C]. chmod 167 note
[D]. chmod 4=rwx, g=rw note
[E]. None of the above

Answer: Option A

Explanation:

No answer description available for this question.

Scb said: (Sep 15, 2011)  
You can use octal number to represent mode/permission:

* r: 4
* w: 2
* x: 1

For example, for file owner you can use octal mode as follows. Read, write and execute (full) permission on a file in octal is
0+r+w+x = 0+4+2+1 = 7

Only Read and write permission on a file in octal is
0+r+w+x = 0+4+2+0 = 6

Only read and execute permission on a file in octal is
0+r+w+x = 0+4+0+1 = 5

Use above method to calculate permission for group and others. Let us say you wish to give full permission to owner, read & execute permission to group, and read only permission to others, then you need to calculate permission as follows:
User = r+w+x = 0+4+2+1 = 7
Group= r+w+x = 0+4+2+0 = 6
Others = r+w+x = 0+0+0+1 = 1

Effective permission is 761.

Suraj said: (Apr 2, 2016)  
How select a read = 4 & write = 2.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.