Redhat Linux - 更改目录颜色
我使用的是 Redhat Linux,我面临的问题是目录的“蓝色”颜色在黑色背景上几乎不可见。我在网上发现了一些帖子,要求更改文件 /etc/profile.d/colorls.sh 和 /etc/profile.d/colorls.csh 中的某些设置>。但是,这将更改每个登录系统的人的颜色设置。有人可以告诉我如何更改仅影响我的颜色设置吗?
I am using Redhat Linux and the problem I am facing is that the "blue" colour of the directories is hardly visible on the black background. I found some posts on the web which asks to change some settings in the file /etc/profile.d/colorls.sh and /etc/profile.d/colorls.csh. However, this will change the colour settings for everyone who logs into the system. Could someone please let me know how I can change the colour settings that will affect only me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要指定ls输出的颜色,需要设置LS_COLORS。在您的 .zshrc 中,尝试添加:
34 是蓝色,33 是...淡黄色。更改该数字并找到您喜欢的内容。
使用 dircolors 来感受 LS_COLORS 应该是什么样子,并添加 -p 查看颜色列表。
To specify the colors of the output of ls, you need to set LS_COLORS. In your .zshrc, try adding:
34 is blue, 33 is ... yellowish. Change that number and find what you like.
Use dircolors to get a feel for what LS_COLORS should look like and add -p to see a color list.
Joachim 的答案非常适合解决目录的特定问题,但如果任何其他实用程序使用“蓝色”颜色输出,则您会发现它们同样难以理解。
不同的终端模拟器有不同的更改颜色的设置;我选择的终端模拟器读取 X 资源来确定使用什么颜色:
color4
是有问题的蓝色;我的设置是这样的:这给出了黑色背景,不太亮的前景,并且大多数其他颜色都足够合理。 (我也发现默认的蓝色不可读。)我将它们放入我的
~/.Xresources
文件中,它们在登录后或将此文件与 X 资源数据库合并后生效:xrdb -合并~/.Xresources
。当然,不同的终端配置也不同。检查您的终端的联机帮助页,了解有关更改常用颜色的更多详细信息。
Joachim's answer is good for fixing the specific issue of directories, but if any other utilities output using the "blue" color, you will find them just as unreadable.
Different terminal emulators have different settings for changing the colors; my terminal emulator of choice reads X resources to determine what colors to use:
color4
is the blue in question; I have mine set like this:This gives a black background, not-too-bright foreground, and most other colors are reasonable enough. (I too found the default blue unreadable.) I put these into my
~/.Xresources
file, and they take effect after log in or after merging this file with the X resources database:xrdb -merge ~/.Xresources
.Of course, different terminals are configured differently. Check your terminal's manpage for more details on changing the colors of the usual colors.
您可以查看全局文件中执行的操作,然后将其添加到您的私有
~/.profile
(或类似文件)。You can see what is done in the global file, and then add it to your private
~/.profile
(or similar file.)samolod 解决方案很好。
如果是 KDE konsole,您可以访问
设置->编辑当前个人资料 ->外观->编辑->颜色 5。
然后使用图形颜色选择器使其更亮(我选择#5871FF)。
samolod solution is good.
In case of KDE konsole you go to
Settings -> Edit current profile -> Appearance -> Edit -> Color 5.
Then use graphical color chooser to make it brighter (I picked #5871FF).