Analysis of the command prompt format in Linux

Source: Internet
Author: User

Analysis of the command prompt format in Linux

Generally, the command prompt format is "[user name @ Computer Name Current Directory] command prompt". Of course, you can modify it, that is, edit ~ /. Bashrc file, find the PS1 definition, in which PS1 is the variable that defines the command prompt.

The meanings of each symbol are as follows:

\ U is the current Login User Name

\ H is the name of the current computer

\ H is the full name of the current computer domain name

\ W is the current directory

\ W is the last entry of the current directory, that is, basenmae

\ $ The average user is $, and the root user is #

\ T is the current time, in the 24-hour format

\ T is the current time, in 12-hour format

\ @ Display AM or PM

\ D current date

\ V is a bash version.

\ V is the bash release version.

\ S is the shell Name

\! Is the history number of the bash command

\ J is the job serial number

\ L is the terminal name of shell.

The above \ W is shorter than \ w

Related Article

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.