How to change your shell prompt

Source: Internet
Author: User

Http://www.understudy.net/custom.html

 

Description CSH * Ksh Bash Tcsh * Zsh
Current working directory $ CWD $ Pwd \ W %/ %/
Current working directory, with one's home directory '~ ' $ CWD: T $ PWD ##*/ \ W % ~ % ~
Full hostname 'Uname-N' 'Uname-N' N/ % M % M
Hostname up to the First '.' 'Hostname-S' 'Hostname-S' \ H % M % M
Start (STOP) boldfacing Mode % B (or % B) N/ N/ % B (or % B) % B (or % B)
Start (STOP) standout Mode % S (or % s) N/ N/ % S (or % s) % S (or % s)
Start (STOP) Underline Mode % U (or % u) N/ N/ % U (or % u) % U (or % u)
User Name 'Whoam' 'Logname' \ U % N % N
The shell's tty that the user is logged in on % L N/ N/ % | % |
The current history number % H N/ \! % H (or % !) % H (or % !)
Name of the shell N/ N/ \ S N/ N/
Time of day in 12-hour hh: Mm AM/PM % T N/ \@ % T (or % @) % T (or % @)
Time of day in 24-hour hh: mm % T N/ \ % T % T
Time of day in 12-hour with seconds hh: mm: ss am/PM % P N/ \ T % P N/
Time of day in 24-hour with seconds hh: mm: NN % P N/ \ T % P % *
The day in 'dd' format % D N/ N/ % D N/
The month in 'mon' format % W N/ N/ % W N/
The month in 'mm' format % W N/ N/ % W N/
The year in 'yy' format % Y N/ N/ % Y N/
The year in 'yyyy' format % Y N/ N/ % Y N/
The date in "weekday month date" Format N/ N/ \ D N/ N/
The date in day-dd format N/ N/ N/ N/ % W
The date in MON/DD/yy format N/ N/ N/ N/ % W
The date in YY-mm-dd format N/ N/ N/ N/ % D
The weekday in 'day' format % D N/ N/ % D N/
Description CSH * Ksh Bash Tcsh * Zsh

Set prompt = "'whoam' % B [% @] % B @ % m [%/] #"

Current user bold current time not bold @ machine name [current working directory]

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.