How can I make my terminal's command prompt shorter to increase line realestate?

I would like to make my terminal's command prompt shorter. Currently I am using Python 's virtualenv and virtualenvwrapper so that is causing lots of extra text to be displayed in my command prompt. I need to shorten that up to the bare minimum so I'd like to take this:

(pytutorial)sez@sez-laptop:~/.virtualenvs/nettuts/firstblog$

and ideally turn it into

(pyt)sez:~/.virtualenvs/nettuts/firstblog$

or maybe something shorter perhaps. Right now I am using Gnome Terminal 2 & bash.

Any suggestions?


Your prompt can be set utilizing the PS1 envvar. For example to have a minimalist command prompt of '$" simply set PS1='$' in your .bashrc. Here are some good examples of setting a customized prompt


I guess \u:\w\$ is what you need, where \u is your username and \w is the current working directory (\W is shorter). Modify your ~/.bashrc to change the prompt.


Edit your .bashrc and change the PS1 definition. See your own /etc/bashrc for an example, or see bash documentation.