Command prompt modification of Linux

Source: Internet
Author: User

Linux command prompt can be changed according to personal preferences, modify the value of PS1;

Under Ubuntu, if only the individual users under the modification of ~/.profile file, all users of the unified modified/etc/profile;

Join:

Export ps1= ' [/[email protected]/h/w/]/$ '

where/u displays the current user account

/h Displays the current host name

/w Displays the current path (uppercase W is a relative path, and lowercase w is an absolute path)

/$ display ' $ ' symbol

PS1: Settings for the prompt
PS1 (is the number 1 instead of the letter L), each version of Bash's PS1 variable within the special symbol may be a little different, you can first man bash.

/d: Represents a date in the format weekday month date, for example: "Mon-1"
/h: The full host name. For example: My machine name is: Fc4.linux, then this name is Fc4.linux
/h: Only the first name of the host is taken, as in the example above, then Fc4,.linux is omitted
/T: Display time in 24-hour format, e.g. HH:MM:SS
/T: Display time in 12-hour format
/A: Display time in 24-hour format: hh:mm
/u: Current user's account name
Version information for/v:bash
/w: The full working directory name. Home directory will be replaced by ~
/w: Use basename to get the working directory name, so only the last directory is listed
/#: The first few commands issued
/$: Prompt character, if root, Prompt is: #, normal user is: $

For Ubuntu to modify the. bashrc file in $home, add ps1= "/w >" and so on, you can modify the prompt.

Original address: http://blog.csdn.net/humorrat/article/details/5615167

Command prompt modification of Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.