. Bashrc Config File

Source: Internet
Author: User

~ /. Bashrc

 

1
, Bash
The prompt is a PS1 variable. The default is an environment variable. The following contains a complete list of the symbols bash uses in PS1:

/A ascii Bell character (you can also type/007)
/D "wed Sep 06" format date
/E ascii escape character (you can also type/033)
/H the first part of the Host Name (such as "mybox ")
/H Host Name (for example "")
/J number of processes suspended by pressing ^ Z in this shell
/L the terminal device name of the shell (such as "ttyp4 ")
/N linefeed
/R carriage return
/S Shell Name (such as "bash ")
/T 24-hour time (for example, "23:01:01 ")
/T 12-hour time (for example, "11:01:01 ")
// @ 12-hour time with AM/PM
/U User Name
/V bash version (for example)
/V bash version (including Patch Level )? /TD>;
/W current working directory (for example, "/home/drobbins ")
/W "basename" of the current working directory (for example, "drobbins ")
/! Position of the current command in the History buffer zone
/# Command number (as long as you type the content, it will accumulate at each prompt)
/$ If you are not a Super User (Root), insert a "$"; if you are a super user, a "#" is displayed "#"
/Xxx insert an ASCII character in the format of "three-digit XXX" (replace unused digits with zero, for example, "/007 ")
// Backslash
/[This sequence should appear before the Character Sequence without moving the cursor (such as the color escape sequence. It enables Bash to correctly calculate the line feed.
/] This sequence should appear after the non-printable character sequence.

Color is selected by adding a special sequence in PS1-basically a numerical value between "/E [" (escape square brackets) and "M. If more than one numeric code is specified, separate them with semicolons.
The following is a color code example:
"/E [0 m"

If the numeric code is set to zero, it notifies the terminal to reset the foreground, background, and bold settings to their default values. You may use this code when the prompt line ends to make the text you typed non-color. Now let's take a look at these color codes. Note the following screenshot results:

Color Table
Foreground background color
---------------------------------------
30 40 black
31 41 colors
32 42 colors
33 43 colors
34 44 colors
35 45 Violet colors
36 46 green colors
37 47 white

Code meaning
-------------------------
0 off
1 highlighted
4 underline
5 flashes
7. Reverse display
8 invisible
To use this table, first find the color you want to use, and then find the corresponding foreground number (30-37) and background number (40-47 ). For example, you can set the numbers to 32 and 40, respectively, if you prefer black-green text. Then open your prompt line definition and add the appropriate color code in it.

PS1 = '/E [34 m </u @/T/W>/n/E [0 m/E [36; 1 m/$'
Export PS1

 

2. Alias defines its own command shortcuts, such:

Alias AMSS = 'CD/Media/Disk/resource/Qualcomm/76xxtsncjnlym4735/HY11-VR356-9_4.7.35/AMSS/products/76xx'

Alias droid = 'CD/home/Xie/quallcomm/a47354009'

Alias droidt = 'CD/home/Xie/quallcomm/a47354009/out/target/product/msm7627_ffa /'

Alias droidh = 'CD/home/Xie/quallcomm/a47354009/out/host/linux-x86/bin /'

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.