Multiple choice technology operating systems

A file in UNIX has -rwxr-xr-x permissions. Using which of the below commands, the permissions on the file be changed so that group and others only have read permission on the file?

  1. chmod 677 <filename>

  2. chmod u+rwx,gr+rw <filename>

  3. chmod a+r <filename>

  4. chmod 744 <filename>

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Current permissions -rwxr-xr-x (755) mean: owner has rwx, group has r-x, others have r-x. To give group and others only read permission, we need rwxr--r-- which is 744 in octal. Option A (677) gives group write permission. Option B has syntax errors and adds write for group. Option C (a+r) gives read to all but doesn't remove execute.