RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


What command is used to change the owner of a file in Linux?

  1. chown

  2. chmod

  3. useradd

  4. usermod

The correct answer is: chown

The command used to change the owner of a file in Linux is chown. This utility allows you to change the user and/or group ownership of a file or directory. When you run the chown command, you specify the new owner's username (and optionally the new group name) followed by the file or directory you want to modify. For example, `chown username:groupname filename` would change the owner to "username" and the group to "groupname" for the specified file. In contrast, chmod is used to change the permissions associated with a file or directory rather than its ownership. useradd is a command for creating new user accounts on the system, and usermod is used to modify existing user accounts. Hence, these commands serve different purposes within the Linux operating system and do not affect file ownership directly like chown does.