如何着色Linux终端的前台和后台文本 [英] How to color Linux terminal foreground and background text

查看:175
本文介绍了如何着色Linux终端的前台和后台文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux终端上工作。终端的前景和背景颜色很难看。

I am working on a Linux terminal. The terminal foreground and background colors are hard to look at.

有没有办法更改终端提示符颜色并保持命令(ls)的颜色相同?

Is there a way to change the terminal prompt colors and keep the commands (ls) at the same colors?

推荐答案

如何在Linux终端中对命令提示符进行着色。这将给你一个彩色的命令行,一切都是一种颜色。

How to color the command prompt in the terminal in Linux. This will give you a colored command line and everything else is one color.

$ export PS1='\[\033[00;35m\]\u\[\033[00m\]@\[\033[00;35m\]\H\[\033[00m\]:\[\033[00;33m\]\W\[\033[00m\] \$\[\033[00;34m '

如果要使此更改永久生效,请将命令添加到您的 /home/yourusername/.bashrc 文件。

If you want to make this change permanent, add the command to your /home/yourusername/.bashrc file.

这篇关于如何着色Linux终端的前台和后台文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆