What does the chmod command do in UNIX?

What does the chmod command do in UNIX?

a) Changes the owner of a file
b) Changes the permissions of a file
c) Modifies the file content
d) Deletes a file

Answer:

b) Changes the permissions of a file

Explanation:

The chmod command in UNIX is used to change the permissions of a file or directory. Permissions define who can read, write, or execute a file. The command syntax is chmod mode filename where mode refers to the permission settings.

Permissions in UNIX are categorized into three types: read (r), write (w), and execute (x). Each file or directory has three permission sets: one for the file owner, one for the group, and one for others. The chmod command allows the owner to assign or modify these permissions.

Understanding the chmod command is critical for securing files on a UNIX system. By controlling access to files, administrators can prevent unauthorized changes or execution, ensuring that only the right users can interact with specific files.

Reference:

Top 50 Unix MCQ Questions & Answers

Scroll to Top