改变fedora23 konsole的ls输出颜色

不知道什么时候改个颜色要这么费劲了,记得以前在调色板上选一下就可以了,现如今到了23怎么变成这样了。还是说我的方法有问题,谁知道的话麻烦告诉我一下,这里只好先改bashrc中的语句了,总感觉这个方法有点土,不过还好能达到目的。我的把自己的开发环境弄舒坦了,要不无法安心干活。
参考链接为:http://askubuntu.com/questions/466198/how-do-i-change-the-color-for-directories-with-ls-in-the-console

To change your directory colors, open up your ~/.bashrc file with your editor

nano ~/.bashrc
and make the following entry at the end of the file:

LS_COLORS=$LS_COLORS:’di=0;35:’ ; export LS_COLORS
Some nice color choices (in this case 0;35 it is purple) are:

Blue = 34
Green = 32
Light Green = 1;32
Cyan = 36
Red = 31
Purple = 35
Brown = 33
Yellow = 1;33
white = 1;37
Light Grey = 0;37
Black = 30
Dark Grey= 1;30
The first number is the style (1=bold), followed by a semicolon, and then the actual number of the color, possible styles are:

0 = default colour
1 = bold
4 = underlined
5 = flashing text
7 = reverse field
40 = black background
41 = red background
42 = green background
43 = orange background
44 = blue background
45 = purple background
46 = cyan background
47 = grey background
100 = dark grey background
101 = light red background
102 = light green background
103 = yellow background
104 = light blue background
105 = light purple background
106 = turquoise background
All possible colors:

31 = red
32 = green
33 = orange
34 = blue
35 = purple
36 = cyan
37 = grey
90 = dark grey
91 = light red
92 = light green
93 = yellow
94 = light blue
95 = light purple
96 = turquoise
These can even be combined, so that a parameter like:

di=1;4;31;42
in your LS_COLORS variable would make directories appear in bold underlined red text with a green background!

You can also change other kinds of files when using the ls command by defining each kind with:

di = directory
fi = file
ln = symbolic link
pi = fifo file
so = socket file
bd = block (buffered) special file
cd = character (unbuffered) special file
or = symbolic link pointing to a non-existent file (orphan)
mi = non-existent file pointed to by a symbolic link (visible when you type ls -l)
ex = file which is executable (ie. has ‘x’ set in permissions).
*.rpm = files with the ending .rpm
After you alter your .bashrc file, to put the changes in effect you will have to restart your shell.

Source:

COLORS Lscolors - Linux StepByStep
Geek Gumbo - Changing the Directory Color in Bash

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值