Which command ensures new files created within the directory sales are owned by the group sales?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The command that ensures new files created within the directory "sales" are owned by the group "sales" is through setting the setgid (set group ID) bit on the directory. This can be accomplished using the command chmod g+s sales. When the setgid bit is set on a directory, any files created within that directory inherit the group ownership from the directory rather than the user's primary group.

By applying chmod g+s sales, any new files or subdirectories created in the "sales" directory will automatically have their group set to "sales", which is the desired behavior specified in the question. This makes it easier for all users in the sales group to collaborate on files without needing to change group ownership manually each time a new file is created.

While the other answer choices relate to permissions or ownership, they do not achieve the specific outcome of setting the group ownership for new files created in the directory as effectively as setting the setgid bit does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy