What is the name of the shell script that initializes an interactive shell session in Bash?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

In Bash, the script that initializes an interactive shell session is known as .bashrc. This file is executed whenever a new interactive shell is started, and it is typically used to set up user-specific environment variables, aliases, and functions.

When a user logs into a system, if the shell is started as a login shell, it will read the .bash_profile, .bash_login, or .profile in that order. However, for non-login interactive shells, which are more common in terminal emulator sessions, the .bashrc file is the one that gets sourced. This is why it plays a crucial role in customizing the user's shell environment, including settings like prompt appearance and command shortcuts.

The other files mentioned, such as .bash_login and profile, serve different purposes and contexts in the shell's initialization process but do not apply specifically to the initialization of every new interactive shell session like .bashrc does.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy