The default path under Linux system is usually long, it seems very inconvenient, then is there any way to modify the length of the Linux default path hint? Let's learn how to modify the terminal prompt path length under Linux with Xiaobian.
Basically Linux system default path prompt for the full path, although the full path but really long, looks very convenient, may sometimes refer to the total width It looks dazzling, like the following example:
linuxidc@Ubuntu:~/trunk-new/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.17/net /netfilter/commercials$
Basically occupy 80% of the width of the terminal, if you can change to just display the name of the last folder!
Modification method:
The code is as follows:
vim ~/.bashrc
Search PS1
The code is as follows:
if [ “$color_prompt” = yes ]; then
PS1=‘${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\ [\\033[00m\\]:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]\\$ ’
else
PS1=‘$ {debian_chroot:+($debian_chroot)}\\u@\\h:\\W\\$ ’
fi
Locate the text above and note the value of the environment variable for PS1,\\u Is the current user, \\h is the host name, \\w is to display the full path, \\W is to display a simple path, turn w into W!
As for if or else, you can try it, my is effective.
Execute the command after modification
The code is as follows:
$ source ~/.bashrc
can be applied! The following results
linuxidc@ubuntu:commercials$
The above is the way to modify the length of the terminal prompt path under Linux, if you think the default path of the Linux system is too long, try The method described above, the modified path length is shortened a lot, and does not affect the use.
gmtime and localtime are two different functions. Many people are confused when usi
Ubuntu system many files and windows are displayed in the form of code, including the terminal user
Linux system, ss command can be used to view the status of the system socket, and socket as the syst
When importing and exporting multi-threaded Linux system, how many will contact the mydumper tool. R
Two ways to enable IPv6 on Ubuntu systems
How to generate reports using Linux using the Sosreport command
How to use sed command in Linux
Summary of netstat command operation examples in Linux
How to configure XFS file system for Linux system
How Linux cracks root password in single-user mode
How to install and set up Puppet in CentOS 5.5
Linux system VLAN, Layer 3 switching and trunk difference
How to recover after the fstab file is lost under Linux?
How to view the vsftp database db file in Linux
How to use the chown command to change the owner of the Linux file
How to use uniq command to delete text duplicate lines in Linux system
"Double-sided" network people: remote control giants and mobile newcomers
Win10 play StarCraft screen display is not complete how to do
Win10 official version final version number details
Microsoft Windows7 large size file search is very convenient
Some heat of summer on room mine awareness
Disable Windows7 Autoplay Autorun feature
The solution to the fake crash after entering Windows XP system
Extract Win2003 system startup group to expand installation requirements
Win10 th2 official version can directly update this and what is the difference between using ISO?