Linux Foundation Certified System Administrator (LFCS) — Question 23

Which of the following commands changes the ownership of file.txt to the user dan and the group staff?

Answer options

Correct answer: B

Explanation

The correct answer is B because it uses the correct syntax for changing both the user and group ownership by using a colon. Option A is incorrect because it uses a slash instead of a colon, while option C uses flags that are unnecessary for this command, and option D incorrectly places the group option after the filename, which is not the correct syntax.