Author Archive

Customizing Your Bash Command Prompt

September 21, 2011 by danielbeck. 7 comments

When you’re working on your Linux or Mac OS X system’s command line, the prompt is the text to the left of the commands you enter. The default prompt varies for every system, but it usually gives you an indication of your username, your machine’s host name and your current working directory. Also, it ends with a dollar sign $ if you’re working as a normal user. If you’re working with root privileges, it ends with # instead.

The prompt can be customized to include relevant information that can help you increase productivity, to hide information you don’t care about, or to highlight the lines in your terminal output where you entered commands.

This post will show how to customize your bash prompt, and, in the process, explain a few of its more advanced features that improve your productivity. Bash is the default shell on Mac OS X, available for all (or most) Linux distributions, if not already included, and available on Windows via Cygwin.

more »