Already a member? Log in

Sign up with your...

or

Sign Up with your email address

Add Tags

Duplicate Tags

Rename Tags

Share This URL With Others!

Save Link

Sign in

Sign Up with your email address

Sign up

By clicking the button, you agree to the Terms & Conditions.

Forgot Password?

Please enter your username below and press the send button.
A password reset link will be sent to you.

If you are unable to access the email address originally associated with your Delicious account, we recommend creating a new account.

URL: http://www.itworld.com/article/2890147/how-to-make-your-unix-prompts-more-useful-and-interesting.html

Share It With Others!

Comments

如何自定义shell命令行提示符

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.