Linux terminal command line prompt art-PS1 advanced words not to mention, first glance at my command line prompt (a little big): the command line in the figure explains: calendar [calendar date/lunar Date and Time] Calendar [number of directories under the current directory + number of items below the current directory] [current absolute Directory] Calendar [user name @ host name-number of terminals] related configuration file global configuration fil
Linux under PS1 command prompt settingsAdded on the last line of this file: Vim/etc/profileexport ps1= ' [\[email protected]\h \w]\$ ' #这里必须用单引号.\d: Represents the date, in the format weekday month date, for example: "Mon 1" \h: Full host name. For example: My machine name is: Fc4.linux, then this name is Fc4.linux\h: Host name\ t: Display time in 24-hour format, such as: HH:MM:SS \ t: Display time in 12-ho
I. Introduction of PS1PS1 the environment variable used to set the command prompt.The default PS1 content is:[\[email protected]\h \w]\$The default prompt is:[[email protected] ~]#[username @ hostname Path]# (#表示root, $ = Normal user)Second, set PS1Open:vim ~/.BASHRCAdded:ps1= ' [\e[31m\]\[email protected]\[\e[36m\]\h \w]\$\[\e[m\] 'Execution:source ~/.BASHRC\d: Represents the date, formatted as weekday month date, for example: "Mon-1"\h: The full hos
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\], c
Reference
Ubuntu Initial bash prompt color is the same as the program output color, when a large number of output, it is often difficult to find out where the output information began. If you turn the color of the prompt into a more eye-catching color, it's easy to locate the output information at the beginning.When you want to change the prompt color in bash, you can set it by the value of the PS1 variable, and if you put it in the. bashrc file in
[Email protected] ~]# echo $PS 1 # View the main prompt ~]# echo $PS 2 # View from the prompt ~]# export ps1= ' [\[email protected]\h \w]\$ ' # Set the main prompt (temporary), If you want to permanently take effect, you should write ~/.BASHRC\u # user name\h # host name\w # Current working directory\ t # time (HH:MM:SS)\$ # If the root user displays ' # ' otherwise displays ' $ 'Shell Features:
After you successfully log on to a text interface, in most cases,
You will see a flickering square or bottom line on the screen (depending on different versions ),
We call it a * cursor * (cursor ).
The cursor is used to tell you where the button
PS1 amp; #39; [/[/033 [01; 32 m/]/h:/[/033 [01; 34 m/]/W/[/033 [00 m/]/$ amp; #39; a simple explanation: the useful information in the question is: PS1 = amp; #39; [/h:/W]/$ amp; #39; /h display the current host name/W display the current directory/$ prompt [] in order to display the results as follows:
PS1 = '[/[/033 [01; 32 m/]/h:/[/033 [01; 34 m/]/W/[/033
MYSQL subquery and nested query optimization instance parsing, mysql nested instance Parsing
Query the highest score of the game history score of 100
SQL code
SELECT ps.* FROM cdb_playsgame ps WHERE ps.credits=(select MAX(credits) FROM cdb_playsgame ps1 where ps.uid=ps1.uid AND ps.gametag=ps1.gametag) AND ps.gametag='yeti3' GROUP BY ps.uid order by ps.credits
PS1 = '[/[/033 [01; 32 m/]/h:/[/033 [01; 34 m/]/W/[/033 [00 m/]/$'A brief explanation:The useful information is as follows:PS1 = '[/h:/W]/$'/H display the current host name/W display the current directory/$ Prompt[] For beautyThe result is as follows:[Taoyue: ~] $Add colors./[/033 [01; 32 m/]: The host name is green./[/033 [01; 34 m/]: the current directory is blue./[/033 [00 m/]: set the following color to the default value.
Other parts are color set
Desktop icons Click the right mouse button, select Properties, modify the working directory to your own git directory:Open quick Edit, when the left mouse button can randomly select text, enter key copy. The right mouse button is pasted. In addition, the pasted shortcut key is the Inerst keyTo modify the default window sizeIf you feel that your git bash is running slow, modify the GIT installation directory Etc/profile file contents, comment out the PS1
Article Title: linuxPS1 prompt definition. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Note:
Usage:
# PS1 = 'custom Content'
Note the single quotation marks on both sides.
Example: PS1 = '(\ u @ \ H \ d \ t) \ $'
Bytes ------------------------------------------------
. Color ConfigurationIn order to set the terminal color, we need to~/.BASHRCIn the filePS1variable to be customized. First open the file with the "gedit ~/.BASHRC" command and find the location of the PS1 variable:Figure 2 PS1 variables in the. bashrc fileThese lines of code believe that it is not difficult to understand, simply said: In the case of color mode open, the
Note:Usage:# PS1 = 'custom Content'
Note the single quotation marks on both sides.
Example: PS1 = '(\ [email protected] \ H \ D \ t) \ $'
Bytes ----------------------------------------------------------------------------------------------------------------
PS1: the user's usual prompt.PS2: the first line is not complete. Wait for the prompt entered in the second
We use the Linux system when the most contact is its command line window, many times we need to enter commands on the command line, before the input command will have a prompt, the general system default prompt form is: [[email protected] working directory]$.In fact, we can customize the command line prompt for ourselves, the Linux system prompt is defined by the system variable PS1, as long as the value of the PS
lineIn bash, you can change the value of the PS1 environment variable to set the prompt line, as shown below:
$ export PS1="> ">
The change will take effect immediately. by placing the "export" definition in your ~ The/. bashrc file can fix this change. As long as you want, PS1 can contain any number of plain text:
$ export
Practical and interesting bash command prompt line
The color and so on can be used freely.
1. Add a smiley face symbol to the successfully executed command:
If the command is successfully executed, you will receive a smiling face as your command line prompt. Once the command fails, the command line prompt will be replaced with a crying face. Flash and highlight.
PS1 = "\ 'If [\ $? = 0]; Then ECHO \ [\ e [40 \; 33 \; 5 \; 1m \] ^ _
The guy who is familiar with DOS is trying to make UNIX like DOS,
One of them is to set the Unix prompt as $ p $ G. The following describes the method.
The GNU bash (Bourne again shell) is more convenient for different shell settings)And KSh (Korn shell) and tcsh (enhanced version of CSH, CSH in Linux isSymbol connection ). The General Sh (Bourne shell) and CSH settings are cool. One by oneVarious shell setting methods:
Ksh:Because KSh treats the prompt variable
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.