nerdexam
Linux_Foundation

LFCS · Question #266

Which of the following configuration files should be modified to set default shell variables for all users?

The correct answer is B. /etc/profile. To set default shell variables for all users system-wide, the /etc/profile file is the appropriate configuration file to modify.

Submitted by hassan_iq· Apr 18, 2026User and Group Management

Question

Which of the following configuration files should be modified to set default shell variables for all users?

Options

  • A/etc/bashrc
  • B/etc/profile
  • C~default/.bash_profile
  • D/etc/skel/.bashrc
  • E/etc/skel/.bash_profile

How the community answered

(35 responses)
  • B
    91% (32)
  • C
    3% (1)
  • D
    6% (2)

Why each option

To set default shell variables for all users system-wide, the /etc/profile file is the appropriate configuration file to modify.

A/etc/bashrc

/etc/bashrc is typically executed for interactive non-login shells. While it can be sourced by /etc/profile or user .bashrc files, /etc/profile is the primary place for system-wide login shell variables.

B/etc/profileCorrect

The /etc/profile file is a system-wide configuration script executed by login shells for all users. It is designed for setting global environment variables, PATH, and other default shell settings that should apply to every user upon successful login.

C~default/.bash_profile

`~default/.bash_profile` refers to a specific user's (named 'default') login shell configuration, not a global system-wide file for all users.

D/etc/skel/.bashrc

Files in /etc/skel/ are templates copied to new user home directories; they do not affect existing users or provide global system-wide settings directly.

E/etc/skel/.bash_profile

Similar to D, files in /etc/skel/ are templates for new users and do not set global default variables for all current users.

Concept tested: Global shell initialization files

Source: https://man7.org/linux/man-pages/man5/profile.5.html

Topics

#Shell configuration#Environment variables#System files#User environment

Community Discussion

No community discussion yet for this question.

Full LFCS Practice