Bash Prompt too long?
May 5th, 2009 Category: LinuxPeople often using Putty, xterm or any other Linux test based console will probably now this annoying issue:
- Changing into a deeper directory structure will create an incredible long bash prompt
For me it was quite annoying to have the prompt sometimes wider than the terminal window. In Debian standard configuration this is the case. So I decided to shorten the prompt.
I kept my prompt very simple, the only thing you have to do is to add the following lines to your ~/.bashrc
export PS1="[\u@\h \W]\\$ "
export PS2="> "
Make sure to add it at the end of your .bashrc file in your home directory. Otherwise it may be overwritten by other prompt definitions in your .bashrc.
Before
harry@h1096660:/usr/local/include/ffmpeg$
After
[harry@h1096660 ffmpeg]$
Better
Further links and examples
Related posts:













Leave a Reply