LX0-104 · Question #116
Which of the following files, when existing, affect the behavior of the Bash shell? (Choose TWO correct answers.)
The correct answer is B. ~/.bashrc E. ~/.bash_profile. The Bash shell uses ~/.bash_profile for login shells to set up the environment and ~/.bashrc for interactive non-login shells to define shell functions, aliases, and specific shell settings.
Question
Options
- A~/.bashconf
- B~/.bashrc
- C~/.bashdefaults
- D~/.bash_etc
- E~/.bash_profile
How the community answered
(19 responses)- A5% (1)
- B89% (17)
- D5% (1)
Why each option
The Bash shell uses ~/.bash_profile for login shells to set up the environment and ~/.bashrc for interactive non-login shells to define shell functions, aliases, and specific shell settings.
~/.bashconf is not a standard Bash configuration file.
~/.bashrc is read by interactive non-login shells (like when you open a new terminal window) and is commonly used for defining aliases, functions, and interactive shell-specific settings.
~/.bashdefaults is not a standard Bash configuration file.
~/.bash_etc is not a standard Bash configuration file.
~/.bash_profile is read by login shells (like when you log into a text console or via SSH) and is typically used for setting environment variables and executing startup scripts that affect the entire session.
Concept tested: Bash shell configuration files (login vs. non-login)
Source: https://linux.die.net/man/1/bash
Topics
Community Discussion
No community discussion yet for this question.