Customize Ubuntu command line prompt

Source: Internet
Author: User
If you do not use the command line to learn Ubuntu, the difference between Ubuntu and Windows is not very big. 2. If you want to perform complicated configurations, you must use command line 3 or miss something amazing. The Ubuntu command line can be customized. You can use the following command to display the current prompt settings: echo $ PS1echo $ PS2 $ PS1 is the main prompt settings. In ubuntu, the command line is generally: $ {debian_chroot: + ($ debian_chr

To learn about Ubuntu, if you do not use the command line, then:

1. The difference between Windows and Windows is not very big.
2. If you want to perform some complex configurations, you must use the command line
3. You may have missed something amazing.

The Ubuntu command line can be customized. You can use the following command to display the current prompt settings:
Echo $ PS1
Echo $ PS2

$ PS1 is the main prompt setting. In ubuntu, it is generally:
$ {Debian_chroot: + ($ debian_chroot)} \ u @ \ h: \ w \ $
$ PS2 is a secondary prompt, generally "> ".

The specific prompts are classified as follows:

Main information:
\ U current Login User Name
\ H current computer name (for example, ubuntu)
\ H Domain Name of the current computer, for example (ubuntu.ubuntu.com)
\ W Current Directory
\ W basename of the current directory
\ $ The average user is $, and the root user is>
(The default prompt settings of Ubuntu are displayed)

Time Display
\ T current time (in 24-hour format, HH: MM: SS stands for hour: minute: Second respectively)
\ T current time (in 12-hour format)
\ @ Current time (AM/PM display)
\ D current date

Shell information:
\ V Bash version
\ V Bash release version
\ S Shell Name
\! Bash command history number
\ J job no.
\ L Shell terminal name

Controller:
\\\
\ N line feed
\ R
\]
\ E Esc
\[[


Prepare yourself.

Enjoy the command line and 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.