To change permissions of a file to make it read-only for everyone, which command should you use?

Prepare for the LPI Linux Essentials Exam. Study with flashcards and multiple choice questions, each with hints and explanations. Get exam-ready!

The choice to use the command "chmod 444 filename" is appropriate for making a file read-only for everyone. In the Linux file permission system, the command "chmod" is used to change the file permissions for the user who owns the file, the group that the file belongs to, and everyone else (others).

When you specify "444" as the permission setting, you are instructing the system to assign read permissions (the numerical value 4) to the user, group, and others while denying write (the numerical value 2) and execute (the numerical value 1) permissions. This means that the file can be read by anyone, but it cannot be modified or executed by anyone, ensuring it remains read-only for all users.

The other options reflect different permission settings: "chmod 400" provides read permission only to the owner and no permissions to group and others, which does not satisfy the requirement for making the file read-only for everyone. "chmod 644" gives read and write permissions to the owner while providing read permission to the group and others, which allows modifications. "chmod 755" grants read, write, and execute permissions to the owner and read and execute permissions to group and others, which clearly does

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy