System Management

A user connects to a server over SSH and finds that a PATH change they added to ~/.bashrc is missing in the session, even though it works when they run bash from the prompt. The user's home directory contains both ~/.bash_profile and ~/.profile, and Bash is the login shell. Which file is Bash reading first for this login session?

Show the answer

Correct answerC. ~/.bash_profile

A Bash login shell reads ~/.bash_profile first and, if it exists, skips ~/.bash_login and ~/.profile. It does not read ~/.bashrc unless ~/.bash_profile sources it. ~/.profile is tempting, but it is used only when the other two login files are absent.