Note: How to use: # PS1='Custom content' Note the single quotes on both sides Example: PS1='(\\u@\\H \\d \\t)\\$' PS1: This is the user's usual prompt. PS2: The first line has not been lost, waiting for the prompt entered in the second line. The Linux system prompt is defined by the system variable PS1. The default form of the general system is: [username@host working directory]$. Use the echo $PS1 to get the value of PS1, that is, PS1="[\\u@\\h \\w]"\\$ You can change the PS1 after logging in. Display style, but when you exit the restart login and enter the system, the style becomes the default style of the system. If you want to change its style completely, you can only change it from the configuration file. PS is defined in the .bash_profile in the user root directory. Such as # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs #The following is the value of the set PS1 PS1="[\\u @\\h \\w]\\$" PATH=$PATH:$HOME/bin #Use export to output PS1 so that it can be used in the subshell, which will cause ROOT users to also use this style #export PS1 Use export PATH unset USERNAME The following is a brief description of the meaning of the default special symbol in the environment: \\d : represents the date, the format is weekday month date, for example: "Mon Aug 1" \\H : The full host name. For example: my machine name is: fc4.linux, then the name is fc4.linux \\h: only the first name of the host, for example, fc4, .linux is omitted \\t: display time is 24 Hour format, such as: HH:MM:SS \\T : Display time is 12 hours format\\A : Display time is 24 hours Format: HH:MM \\u : Current user's account name\\v : BASH version information\\w : The full working directory name. The home directory will replace \\W with ~: use the basename to get the working directory name, so only the last directory \\# : the first command issued by the \\$ : prompt character, if it is root, the prompt is: # , Ordinary users are: $
We can make the prompt color by setting the PS1 variable. The format of the character sequence color set in PS1 is: \\[\\e[F;Bm\\] where ``F'' is the font color, number 30~37; ``B'' is the background color, number 40~47. The color output can be turned off by ``\\e[0m''; in particular, when B is 1, the bolded bold text will be displayed. For details, please see the color table and code table below. Color table foreground background color 30 40 black 31 41 red
tcpdump is a commonly used capture tool under the Linux command line, record the usual way, the test
The wait queue in the Linux kernel has many uses for interrupt handling, process synchronization, a
For Linux systems, whether it is a central processor, memory, disk drive, keyboard
ifconfig -a View all NIC information of Linuxifconfig eth0 down Turn off eth0 network cardifconfig e
Shell script recursive function - traverse each directory to operate
Teach you to crack the root password of the Linux system
Set hosts.allow and hosts.deny to block IP on Linux
Teach you to query the time when installing Win7 system
How to make the program run in the background under Linux
How to check the Linux server hard disk I /O read and write load
Using Nginx as both a web cache server and load balancing
Data transfer on the link layer of the linux protocol stack -sk
Cache policy settings considerations
Windows XP Device Manager 3 Application Tips
Win10 system how to cancel the proxy server
Vista adds security tools to introduce
Win10 TH2 quasi-official version 10586 release: fixed problem + known problem summary
FSF: Windows 8 system "safe boot" should be called "restricted boot"
WinXP system breaks through 4G memory constraints and has a trick
Tips for using Windows Vista Calendar
Use Netsh commands to backup and restore network settings
Win7 system prompts Explorer.exe application error 0xc0000142 error window three solutions