.bashrc
The.bashrc
file is a configuration file found in the user's home directory. It is a script that is executed every time a new interactive non-login Bash shell is started.
Before applying any configurations via the .bashrc
file, ensure that the current shell for the system is bash.
The chsh
command can be used to change the default login shell (refer to the subsection under USER MANAGEMENT).
Configurations
Changing the prompt design
For example in Kali Linux 2024.4, to change the prompt to backtrack
, where the prompt kali@kali-desktop
is red in color instead.
Change the line in ~/.bashrc:PROMPT_ALTERNATIVE=twoline
to PROMPT_ALTERNATIVE=backtrack
. Restart the terminal.
What happens is that this changes the block that is executed in the subsequent case
statement, which assigns the PS1
variable a different value.
A custom color can be added too (eg. custom
):
Eg.
Last updated