Multiple choice technology operating systems

"You have created a executable file and the current access mode of the file is: -rw-r--r-- Now, you want to give execute permission only to the owner of this file, without altering any other access. What command you will issue?"

  1. chmod 700 filename

  2. chmod 755 filename

  3. chmod 644 filename

  4. chmod 744 filename

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

Current permissions -rw-r--r-- equal octal 644. To add execute permission for owner only, we change owner from rw- (6) to rwx (7), keeping group and other unchanged at r-- (4 each). This gives 744, which grants owner rwx and everyone else r--.

AI explanation

The file starts at mode 644 (rw-r--r--): owner=read/write, group=read, other=read. The task is to add execute permission for the owner only, leaving group and other untouched. Owner read+write+execute = 7 (4+2+1), group stays read-only = 4, other stays read-only = 4, giving chmod 744. chmod 700 would strip read/write from group and other (altering them). chmod 755 gives execute to group and other too, which the question forbids. chmod 644 doesn't add execute at all. Only 744 satisfies "owner gets execute, nothing else changes."