Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change a beautiful command prompt for terminal in Ubuntu18

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to change a beautiful command prompt for terminal in Ubuntu18". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to change a beautiful command prompt for terminal in Ubuntu18".

VMware and Ubuntu have been reinstalled, but the command line prompt is too monotonous and unattractive, how to change it. So search for Barabara on the Internet.

1. Change the PS1 environment variable, both of which are fine. I choose the first one:

Export PS1= "\ [\ 033 [01bot 31m\]\ u\ [\ 033 [00m\] @\ [\ 033 [00m\]\ h\ [\ 033 [00m\] [\ [033 [01bot 33m\]\ t\ [\ 033 [00m\]]:\ [\ 033 [01ET34m\]\ w\ [\ 033 [00m\] $" export PS1= "\ [\ e [32ip1m\] [\ e [33ET1m\]\ u\ [\ e [31m\]\ u\] 1m\] @\ [\ e [33 × 1m\]\ h\ [\ e [36 × 1m\]\ w\ [\ e [32m\]]\ [\ e [34X 1m\]\ $\ [\ e [0m\] "

two。 Under the ordinary user ls-all, select .bashrc to insert the above export PS1= code at the end of the file, and then enter the following command to take effect.

Source. / .bashrc

3. Then modify the PS1 under root, and use the online method to insert export PS1 and then source at the end of the / etc/profile file, but it is troublesome to source again every time you use root connection in xshell.

At this point, you can find the .bashrc file in the root directory under root, add PS1, and then source. / .bashrc, and each connection will take effect.

To distinguish root from ordinary users, you need to change $to #:

Export PS1= "\ [\ 033 [01bot 31m\]\ u\ [\ 033 [00m\] @\ [\ 033 [00m\]\ h\ [\ 033 [00m\]\ [\ 033 [011033m\]\ t\ [\ 033 [00m\]]:\ [0033 [0134m\]\ w\ [\ 033 [00m\] #" above is all the contents of the article "how to change a beautiful command prompt for terminal in Ubuntu18". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report