LFCS Essential Commands Practice Question
A system administrator needs to change the group ownership of a file to 'developers' and set the setgid bit on a directory. Which two commands accomplish these tasks? (Choose two.)
⚠ Common exam trap
Linux Foundation often tests the distinction between setting the setgid bit on a directory versus a file, and the correct syntax for changing group ownership with `chown :group` versus `chown group:`.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
chmod g+s dir
`chmod g+s dir` sets the setgid bit on a directory, causing new files created within it to inherit the directory's group ownership rather than the creator's primary group. This is a standard Linux permission mechanism for collaborative directories.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
chmod g+s dir
Why this is correct
Sets the setgid bit on the directory.
- ✗
chmod u+s dir
Why it's wrong here
Sets the setuid bit, not setgid.
- ✗
chown developers: file
Why it's wrong here
Changes user owner to 'developers', not group.
- ✓
chown :developers file
Why this is correct
Changes group ownership to 'developers'.
- ✗
chmod g+s file
Why it's wrong here
Sets setgid on a regular file, which has different implications and is not the task.
Go deeper
Related to this question
About these practice questions
One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.