To change the permissions on a file, which command would you use?

Prepare for the LPIC-2 Certification Test with our study tools, including flashcards and multiple choice questions with hints and explanations. Get ready to pass your exam!

To change the permissions on a file, the command utilized is chmod. This command allows users to modify the permission settings for specific files or directories by specifying which users (owner, group, others) can read, write, or execute the files. The flexibility of chmod comes from the fact that it allows both symbolic (using letters to denote permissions) and numeric (using octal notation) modes to set these permissions.

For example, running chmod u+x myfile would add execute permissions for the user who owns myfile, while chmod 755 myfile would set permissions to read, write, and execute for the owner, and read and execute for the group and others.

The other commands listed serve different purposes:

  • chown is used to change the ownership of a file, altering which user or group owns the file rather than the permissions associated with it.

  • chgrp specifically changes the group ownership of a file, but does not affect user permissions.

  • setfacl is used to set Access Control Lists (ACLs), which offer a more granular permission scheme than traditional file permissions, but it is not the primary command for changing standard file permissions.

Thus, when tasked

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy