How to make the terminal’s command prompt shorter to increase line realestate

bashcommand lineshellterminal

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?

Best Answer

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

Related Question