Ubuntu sometimes need to modify the command prompt PS1 when using the command, but many people do not know how to modify PS1, the following small series will introduce you how Ubuntu modify the command prompt PS1 Let's learn together.
command is not convenient nor intuitive multi-line input, in order to modify the command prompt. Modify PS1 in the ~/.bashrc file.
PS1 is the main prompt setting, generally found in ubuntu:
${debian_chroot:+($debian_chroot)}/u@/h:/w/$
The specific prompt, according to the meaning of the classification is as follows:
Main information:
/u Current login user name
/h Current computer name (such as ubuntu)
/H The current domain name of the computer, such as (ubuntu.ubuntu.com)
/w The full path to the current directory. The home directory will be replaced by ~
/W Use the basename to get the working directory name, so only the last directory will be listed
/$ The general user is $, and the root user is "
Time display
/t Current time (24-hour system, HH:MM:SS stands for hour:minute:second)
/T Current time (12-hour system)
/@ Current time (AM/PM display)
/d Current date
Shell information:
/v Bash version
/V Bash release version number
/S Shell name
/! Bash command history number
/j job number
/l Shell terminal name
I am directly omitting the user name and host, modify the 59th line of the 59th line
-------------------------------------------- ----------------
56 if [ “$color_prompt” = yes ]; then
57 PS1=‘${debian_chroot: +($debian_chroot)}/[/033[01;32m/]/u@/h/[/033[00m/]:/[/033[01;34m/]/w/[/033[00m/] /$ ’
58 else
59 #PS1=‘${debian_chroot:+($debian_chroot)}/u@/h:/w/$ ’
60 PS1=‘${debian_chroot:+($debian_chroot)}[/w]/$ ’
61 fi
----------- -------------------------------------------------< Br>
To make the change take effect immediately source ~/.bashrc
After the completion, the command prompt becomes: [~]$
The above is Ubuntu modify the command prompt PS1 The method is introduced, after modifying the command prompt PS1, the system The execution of the command will be much more convenient and I hope to help you.
I chatted with friends before, knowing that I can use PXE to install virtual machin
In Linux system operation, sometimes the system fails to start because the fstab fi
The Ubuntu system automatically detects errors in the program and alerts the user w
Linux system The full name of Go language is golang, which is a programming development language. Th
How to deal with the unresponsive situation of the su command in Linux
Steps to install arping on Fedora 18
Linux can not identify the u disk solution
How to identify Linux system rpm and yum tools
Solution for unusable xmanager passive function under Linux
Linux configuration yum.conf method
Linux file method using file command to identify the file type
How to identify open and fopen functions in Linux
Installing Linux mint graphic tutorial with U disk under Windows
How to check the integrity of downloaded files on Linux system
How to install ADSL broadband connection in win7 system
How to encrypt emails under Linux?
One-click recovery 5.0 recovery can be completed after pressing any key can not be restarted
Windows desktop shortcut icons all become the same icon solution
Win10 first anniversary update version encountered problem summary
How to do virtual machine Hyper-v under Windows10 system?
Windows10 BAD_POOL_CALLER or Bad_pool_caller blue screen failure solution
What are the win10 shortcuts? Win10 commonly used shortcuts summary introduction
Win10 always pops up the notification after the firewall is closed.