Which command changes the owner to 'spankme' and the group to 'baby' for bob.txt?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

Which command changes the owner to 'spankme' and the group to 'baby' for bob.txt?

Explanation:
The command is using the owner:group format to change both attributes in one go. In Linux, chown accepts owner:group followed by the file name, which lets you set the new owner and the new group at the same time. Here, spankme is the new owner and baby is the new group, applied to bob.txt. That exact syntax—spankme:baby bob.txt—changes both fields in one operation. The other forms either change only the owner (leaving the group as it was) or try to set the group to something not intended (for example, misplacing the file name inside the owner:group portion). So the command that specifies both the owner and the group in one pair before the file is the correct choice.

The command is using the owner:group format to change both attributes in one go. In Linux, chown accepts owner:group followed by the file name, which lets you set the new owner and the new group at the same time. Here, spankme is the new owner and baby is the new group, applied to bob.txt. That exact syntax—spankme:baby bob.txt—changes both fields in one operation.

The other forms either change only the owner (leaving the group as it was) or try to set the group to something not intended (for example, misplacing the file name inside the owner:group portion). So the command that specifies both the owner and the group in one pair before the file is the correct choice.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy