How to make your Unix prompts more useful and interesting


Had enough of $ and #? You can make your bash prompts far more interesting and likely a lot more useful by customizing them. You can even change the font color or set up your prompt to change depending on where you're sitting in the file system, what system you're working on, or what time it is.  A customized prompt can serve as a gentle reminder of what system you're working on -- especially helpful if you often find yourself logged into 3-4 systems at a time, window hopping to get several things done at the same time. or if you log in with different accounts. A customized prompt can help if you like to be reminded where you are sitting in the file system or prefer *not* to be reminded where you are in the file system (a full path can take up quite a bit of screen space when you're seven levels deep into /home/username/apps/docs/...).  All you need to do to define your PS1 variable and save it in your .bashrc or .bash_profile file. As it turns out, however, you have a lot of flexibility on what you put into that prompt.
Continue Reading

Share this