At this point, we will often encounter such a problem: the operation of the server because of something interrupted, back to continue to operate the time will certainly be ifconfg to confirm whether I want to operate the server, because it can not be recognized from the image.
Therefore, it is necessary to optimize this PS1 command-line prompt. Every operation and siege Lion must have its own habits, but I still recommend a server batch management in
Linux PS1 prompt definition PS1: Is the user's usual prompt.PS2: The first line is not finished, wait for the second line to enter the prompt.The Linux system prompt is defined with the system variable PS1. The general system default form is: [username@host working directory]$.Use echo $PS 1 to get the PS1 value, i.e.
2016.1.11 today learned to change the color of PS1, how to add PS1 variable to find a file (. bash_profile), or BASHRCExport ps1= "\[\e[32;1m\]test $PWD > \[\e[0m\]"#显示绿色, where test is an additional addition to the content to be displayedExport ps1= "\[\e[35;1m\]test $PWD > \[\e[0m\]#显示红色 have a reference blog http://
Change the color of the PS1 variable.
2016.1.11 today I learned how to change the color of PS1. How to add the PS1 variable to find the file (. bash_profile) or bashrcExport PS1 = "\ [\ e [32; 1m \] Test $ PWD> \ [\ e [0m \]"# Display green, where Test adds additional content to be displayedExport
In Linux environment variables, PS1 is an important environment variable: PS (PromptSign): refers to a command prompt. for example, on a Fedora12 terminal: [liutao @ liutao ~] $. When setting the PS1 environment variable, we need to use some preset special symbols to set PS1. The following is laruence... in Linux environment variables,
# PS1 = 'custom content' pay attention to the single quotation mark examples on both sides: PS1 = '(/u @/H/D/T)/$ 'your PS1: the user's usual prompt. PS2: the first line is not complete. Wait for the prompt entered in the second line. Linux system prompts are defined by the system variable ps1. The default format is [u
We all know that in bash, you can change the color of the prompt by PS1 variables. When the command output is long, it is often not easy to see where the output begins at the first glance, change the PS1 variable by changing it, you can change the color of the bash prompt so that you can look at the crowd and find where the output begins. Also, setting colors can make the command line more beautifulWe can c
The. ps1 file is a script file written by PowerShell. In Windows systems, it is not allowed to execute. ps1 files by default, so how can you allow the system to execute. ps1 files?What is the. ps1 file?This is the script text that PowerShell writes, you can write a PowerShell code in Notepad, then save it as "Xxx.ps1",
PS1 (is the number 1 instead of the letter L), there may be a small difference in the special notation within each version of Bash's PS1 variable, and you can bash the man first. The following are the meanings that the default special symbols in the FC4 environment represent:
\d: Represents a date, formatted as weekday month date, for example: "Mon Aug 1"
\h: The full host name. For example: My machine
At this time, we will certainly often encounter such a problem: the operation of the server because of something interrupted, go back to the operation will certainly be ifconfg to confirm whether I want to operate the server, because the image can not be recognized.
Therefore, it is necessary for us to optimize this PS1 command line prompt. Every operation of the Victoria siege Lions must have their own habits, but I still recommend a server batch ma
Tags: lin China strong BSP Bash result machine name need to be notifiedMy PS1 command prompt: ps1= "\[\e[32;40m\][\[\e[32;40m\]\u \[\e[32;40m\]>>\h \[\e[32;40m\]\w \[\e[36;40m\] (\A) \[\e[32; 40m\]] \[\e[0m\]\$ "1. Set the display of PS1 facePS1 (is the number 1 instead of the letter L), each version of Bash's PS1 vari
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 items... linux Terminal command line prompt art-
Linux Command Prompt PS1 settings-Linux general technology-Linux programming and kernel information, the following is a detailed description. 1. Current prompt:
Echo $ PS1
2. Set the prompt:
Set it in the. bash_profile file under the root directory of the user (this file does not exist, it is created), for example:
PS1 = "[\ u @ \ W] \ $"
Export
Default:
In/etc/bashrc
PS1 = "[\ [email protected] \ H \ W] \ $"
Description:
\: An ASCII Bell character (07)
\ D: The date in "weekday month date" format (e.g., "Tue May 26 ")
\ D {format}: The format is passed to strftime (3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
\ E: An ASCII escape character (033)
\ H: The hostname up t
By default, Ubuntu kernel outputs the complete path. When the path name is long, the prompt method is unfriendly. Modify the settings of the PS1 variable by following these steps to allow the terminal to output the relative path. Similar to the Red Hat system. Change idea: Change w to W to show absolute path, and add [] brackets. First modify the/etc/bash. bashrc file www.linuxidc.com @ linuxidc-laptop :~ $ Sudovim/etc/bash. bashrc modify the followin
Linux environment variables PS1 set linux environment variables PS1 is simply set command prompt display content, as follows: www.2cto.com1root@10.1.1.200 :~ # The meaning of the prompt in the PS1 variable: \ d: indicates the date. The format is weekdaymonthdate, for example, Wed... linux environment variables PS1 set
The. ps1 file is a script file written by PowerShell. In Windows systems, it is not allowed to execute. ps1 files by default, so how can the system allow the execution of. ps1 files?
What is a ". PS1" file?
This is the script text written by PowerShell, you can write a section of PowerShell code in Notepad, then save
The color code is basically clipped between "\ e [" and "m": \ e [32; 1 m
You can use \ e [0 m to disable color output. In particular, when B is set to 1, the highlighted and bold text is displayed.
Common color codes:
Foreground background color
--------------- 30 40 black 31 41 red 32 42 green 33 43 yellow 34 44 blue 35 45 purple 36 46 cyan 37 47 white
Code meaning
---------------- 0 OFF1 highlighted 4 underline5 flashing 7 reversed white display 8 invisible
Change the color of the prompt in
By default, the Ubuntu terminal will output the full path, the path name is very long, the hint is very unfriendly, the following steps to modify the settings of the PS1 variable, you can let the terminal output relative path. Similar to the style of the Red Hat system. Modify the idea: Change W to W to display absolute paths, and add [] brackets.By default, the Ubuntu terminal will output the full path, the path name is very long, the hint is very un
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.