I added this command to my root .bashrc file to add color to my prompt
and to simplify its path portion to the lowest level directory,
Code:
export PS1="\e[1;31m\u@\h:\W\$\e[m "
and my bash prompt comes up ending with $ when I expected #.
Also, occasionally, when I enter a command, part of that command
becomes part of my prompt!
If the following is a prompt and command,
Code:
I'm trying to permanently alter my bash prompt. I've read that I need to edit my .bashrc file. Would someone mind telling me where to find this? Is this the file titled bash.bashrc in the etc folder?
Also, should I edit the "PS1=" section of this file for the desired effect? :confused:
I have 12.04 server minimal running on my VPS. When I ssh into the server, only $ is showing at the prompt for each prompt. There's no typical <directory> <username>$, no autocompletion (bash-completion is installed), and no use of arrow key, etc.
Yes, I know there is a Post your .bashrc! thread. But I'd like to see just the prompts, after all that's what you see when you open your terminal. Ever since I started using Linux I have used the default or recently a borrowed one. Today I checked out a few websites with the aid of Google and I created my own.I wanted some thing simple and clean to compliment #!
I am looking for ideas on customizing my bash shell when I remotely connect to a server.
Currently, I run the following in my remote bash shell to change the prompt to indicate that I am connected to a remote system:
if [ -n "$SSH_CLIENT" ]; then text=" ssh"
fi
export PS1='\[\e[0;31m\]\u@\h:\w${text}$\[\e[m\] '
Additionally, I source the .bashrc file from the .bash_profile file when I ssh in t
I changed my bash prompt to this:
PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] "
Sorry for the long line, it is mostly due to colors. Basically when I hit the up arrow to go back in Bash history the prompt disappears and everything screws up.
It is similar to this question but I don't know if a \[
is missing and where.
In the next couple lessons here at Nocturnal Slacker v1.0 we'll be discussing the Bourne Again Shell (BASH) in a bit more detail.With that in mind, though, how 'bout we play around with a neat trick that will customize your BASH prompt whenever you go to the command line? Sound like fun? OK, here we go...There's a file in your /home/<your_username> directory called .bashrc.
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup