Which of the following configuration files should be modified to globally set shell variables for all users?
A. /etc/profile
B. /etc/bashrc
C. ~/.bash_profile
D. /etc/.bashrc
E. /etc/shellenv
Which of the following configuration files should be modified to globally set shell variables for all users?
A. /etc/profile
B. /etc/bashrc
C. ~/.bash_profile
D. /etc/.bashrc
E. /etc/shellenv
The question is poorly formulated. Environment variables stored in profile and shell variables should be in bashrc.
So people tend to choose B here which is more logical.
But the correct answer here is the only _A_, because there is no /etc/bashrc file on debian10, debian7 or ubuntu systems existed. The correct file is /etc/bash.bashrc which sourced from /etc/profile
The only OS where I have found /etc/bashrc – it’s centos8
B
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile