First, append the following lines to your ~/.bashrc file:
##
## INCLUDE CUSTOM `.bashrc` CODE
##
if [ -f ~/.bashrc_custom ]; then
. ~/.bashrc_custom
fi
Create the custom file:
touch ~/.bashrc_custom`
Finally open it and put the following lines into:
# File: $HOME/.bashrc_custom
# THIS FILE IS A USER-CUSTOM BASHRC FILE TO KEEP CLEAN THE DEFAULT ~/.barshrc FILE.
# PUT THERE ANY CUSTOM CODE MANUALLY ADDED BY YOU
# Add a new line at the end of the command prompt
#PS1=${PS1}\\n
PS1=${PS1%?}
PS1=${PS1%?}\n'$ '
The next opened shell session will looks like following:
Open the file
~/.bashrc
(or/etc/bash.bashrc
if it should work globally for all users).Locate the variable called
PS1
.Simply put an
\n
at the end of the value of thePS1
variable.I prefer using a custom
.bashrc
fileFirst, append the following lines to your
~/.bashrc
file:Create the custom file:
Finally open it and put the following lines into:
The next opened shell session will looks like following:
This was painful, but in the end, due to a complicated custom PS1 setup with custom colors, this is the only thing that worked for me: