有没有办法部分编辑我的bash颜色主题?

时间:2017-09-20 07:22:03

标签: linux bash shell ubuntu themes

几个月前我在某个网站上创建了自定义bash颜色主题。 但是,我现在只想在我的bash主题中编辑一些颜色。 但是很难理解它们在下面的截图中的含义。

enter image description here

我很好奇的是,是否有某种方法可以编辑我的bash颜色 某些部分。

+这是我第一次在这里发帖提问,所以我担心我的问题很糟糕。如果我这样做,请告诉我问题。非常感谢你。

2 个答案:

答案 0 :(得分:0)

$LS_COLORS ls 主题,而不是 bash 主题。

这是一个以冒号分隔的规则列表,其格式为key=pattern,其中键为

no    NORMAL, NORM            Global default, although everything should be something
fi    FILE                    Normal file
di    DIR                     Directory
ln    SYMLINK, LINK, LNK      Symbolic link. If you set this to ‘target’ instead of a numerical value, the color is as for the file pointed to.
pi    FIFO, PIPE              Named pipe
do    DOOR                    Door
bd    BLOCK, BLK              Block device
cd    CHAR, CHR               Character device
or    ORPHAN                  Symbolic link pointing to a non-existent file
so    SOCK                    Socket
su    SETUID                  File that is setuid (u+s)
sg    SETGID                  File that is setgid (g+s)
tw    STICKY_OTHER_WRITABLE   Directory that is sticky and other-writable (+t,o+w)
ow    OTHER_WRITABLE          Directory that is other-writable (o+w) and not sticky
st    STICKY                  Directory with the sticky bit set (+t) and not other-writable
ex    EXEC                    Executable file (i.e. has ‘x’ set in permissions)
mi    MISSING                 Non-existent file pointed to by a symbolic link (visible when you type ls -l)
lc    LEFTCODE, LEFT          Opening terminal code
rc    RIGHTCODE, RIGHT        Closing terminal code
ec    ENDCODE, END            Non-filename text
*.extension                   Every file using this extension e.g. *.jpg

和pattern是以分号分隔的效果和颜色列表

效果

00  Default colour
01  Bold
04  Underlined
05  Flashing text
07  Reversetd
08  Concealed

颜色

30  Black
31  Red
32  Green
33  Orange
34  Blue
35  Purple
36  Cyan
37  Grey

背景

40  Black background
41  Red background
42  Green background
43  Orange background
44  Blue background
45  Purple background
46  Cyan background
47  Grey background

额外的颜色

90  Dark grey
91  Light red
92  Light green
93  Yellow
94  Light blue
95  Light purple
96  Turquoise
97  White
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

Configuring LS_COLORS

答案 1 :(得分:0)

如果您不熟悉终端颜色的工作方式,我强烈建议您阅读this article,或者只是在网上搜索 ANSI / VT100颜色代码

话虽如此,让我们看看你的代码片段中的部分代码。 (另外,将来请记住将代码复制并粘贴到代码块中,以便我们更容易编辑/调试/复制粘贴。

术语LS_COLORS表明它根据自定义标准为ls命令的输出着色。进一步的检查表明,它赋予了一定的风格"记录每种文件类型。

因此,例如,*.zip(即所有zip文件)的样式设置为01;31。现在参考上面的文章。这些属性由;分隔,并按顺序排列"样式; foreground_color; background_color"。所以,在你的情况下,我猜测不包括背景颜色。因此,第一部分01将文本格式设置为粗体,31将文本颜色设置为红色。

只需编辑该语句中的颜色,然后保存文件,重启终端后应该会看到更改。