Which chmod command sets owner read/write/execute and group/others read/execute on a file named secret.txt?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which chmod command sets owner read/write/execute and group/others read/execute on a file named secret.txt?

Explanation:
This question tests how file permissions map to the three-digit octal mode used by chmod. Each digit represents a class: owner, group, and others, and the digit is the sum of permission bits: read is 4, write is 2, execute is 1. You want the owner to have read, write, and execute, which equals 7 (4+2+1). You want the group and others to have read and execute, which equals 5 (4+1) for each. Put together, that gives 755. Therefore, the command to set those permissions on secret.txt is chmod 755 secret.txt. The other options don’t match this exact pattern: 754 would give others only read (no execute); 777 would grant all permissions to everyone (more permissive than required); 644 would give no execute permission to anyone.

This question tests how file permissions map to the three-digit octal mode used by chmod. Each digit represents a class: owner, group, and others, and the digit is the sum of permission bits: read is 4, write is 2, execute is 1. You want the owner to have read, write, and execute, which equals 7 (4+2+1). You want the group and others to have read and execute, which equals 5 (4+1) for each. Put together, that gives 755. Therefore, the command to set those permissions on secret.txt is chmod 755 secret.txt. The other options don’t match this exact pattern: 754 would give others only read (no execute); 777 would grant all permissions to everyone (more permissive than required); 644 would give no execute permission to anyone.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy