The default path hint is the full path, so the line is long and may take up the full width, looking very uncomfortable! Just like this.
[Email protected]:~/trunk-new/build_dir/target-mips_34kc_uclibc-0.9.33.2/linux-ar71xx_generic/linux-3.10.17/net /netfilter/commercials$
Basically occupy the width of terminal 80%, if it can be changed to show only the last folder name is good!
Modification Method:
Vim ~/.BASHRC
Search PS1
If ["$color _prompt" = yes]; Then ps1= ' ${debian_chroot:+ ($debian _chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m \]\w\[\033[00m\]\$ ' ps1= ' ${debian_chroot:+ ($debian _chroot)}\[email protected]\h:\w\$ ' fi
Find the above text, pay attention to the PS1 environment variable value, \u is the current user, \h is the hostname, \w is the full path, \w is to display a simple path, w into W can be!
As for if or else in effect, you can try it, mine is else in effect.
Execute command after modification
$ source ~/.BASHRC
You can apply it! The following results
is not very concise ...
Modify the command prompt line path length under Linux