In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to modify the path length of terminal prompt in Linux". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
Basically, the default path prompt under Linux system is the complete path, although it is a complete path, it is really long and looks very inconvenient, which means that sometimes it may occupy the entire width and look dazzling, just 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$
Basic occupation of 80% of the terminal width, if you can change to show only the name of the last folder would be good!
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
Find the above text, pay attention to the value of PS1 environment variable,\u is the current user,\h is the host name,\w is to show the complete path,\W is to show the simple path, w can be changed to W!
If it is, or if it is, then I will try it out.
Execute command after modification
The code is as follows:
$ source ~/.bashrc
It can be applied! following results
linuxidc@ubuntu:commercials$
"Linux how to modify the terminal prompt path length" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.