PS1 Color Customization

Source: Internet
Author: User

Real columns:

My PS1 settings: (Each color change must add \] to end, otherwise it will appear the input long command does not wrap)

Ps1= "[\[\e[1;31m\]\u\[\e[0m\]\[\e[1;33m\]@\h\[\e[0m\]\[\e[1;32m\] \w\[\e[0m\]] \\$"

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6C/6D/wKioL1VJjIHDi6SdAAIb4lirmm8333.jpg "title=" Secai.png "alt=" Wkiol1vjjihdi6sdaaib4lirmm8333.jpg "/>


Set Format:

Open \[\e[f; Bm\], close \[\e[0m\]

Echo-e "\[\e[1;31;40m\" this red! \[\e[0m\] "

Color:

F B

30 40 Black

31 41 Red

32 42 Green

33 43 * * *

34 44 Blue

35 45 Purplish red

36 46 Cyan Blue

37 47 White

Property:

\33[0m Close All Properties

\33[1m Setting High brightness

\33[4m Underline

\33[5m Flashing

\33[7M Reverse Display

\33[8m blanking

\33[30m-\33[37m Setting the foreground color

\33[40m-\33[47m Setting the background color

\33[na the cursor to move n rows

\33[NB cursor down n rows

\33[NC cursor right shifts n rows

\33[nd cursor left n rows

\33[Y;XH Setting the cursor position

\33[2J Clear Screen

\33[k clears the contents from the cursor to the end of the line

\33[s Save Cursor position

\33[u Restore cursor Position

\33[?25l Hide Cursor

\33[?25h Display cursor


PS1 settings:

Here's a brief talk about what the default special symbols mean:

\d: Represents the date, formatted as weekday month date, for example: "Mon Aug1"

\h: The full host name.

\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 such as: 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: $


This article is from the "Dream You want" blog, please be sure to keep this source http://zmyxn.blog.51cto.com/3029175/1642434

PS1 Color Customization

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.