All Questions
4
questions
2
votes
2
answers
3k
views
How to insert bash scripts inside the PS1 variable
I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working:
PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder has ...
0
votes
1
answer
139
views
Prompt Customization Query - PS1='[\u@\h]\!:echo $? $ '
If in .bashrc the following reports the 'history number of the current command' (and the exit code of the last command), how can I configure it to report the 'history number of the previous command'?
...
40
votes
2
answers
12k
views
Linux: coloring bash prompt will break carriage return
When I try to colorize the bash prompt like this:
export PS1="\e[0;31m[\u@\h \W]\$ \e[m "
it breaks the carriage return (instead of going to a new line when line is full, it starts in the same line ...
1
vote
1
answer
177
views
Formatting my $PS1 to x amount of character
I'm looking for a way to force my PS1 variable to a certain number of chars.
It currently looks like:
$PS1="\W $"
and I'm trying to keep the same number of characters regardless of the length of ...