A Linux administrator needs to define a system-wide environment variable that must be set for all users when they initiate a login shell. This variable should not affect non-login shells or system services that do not start with a login shell. Which of the following files is the most appropriate for this configuration?
The correct answer is /etc/profile. This file is executed for all users whenever a login shell is started. It is the standard and most appropriate location for setting system-wide environment variables and running commands that should only apply to login sessions. /etc/bashrc is incorrect because it is sourced for interactive non-login shells, not specifically login shells. ~/.profile is incorrect because it is a user-specific file, located in a user's home directory, and does not apply system-wide. /etc/skel/.profile is a template file used only when new user accounts are created; it does not affect existing users.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between a login shell and a non-login shell?
Open an interactive chat with Bash
Why is `/etc/profile` specifically used for system-wide configuration?
Open an interactive chat with Bash
How does `/etc/skel` differ from `/etc/profile` in terms of functionality?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .