亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

ls colours

系統 1603 0
bash:
LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
export LS_COLORS


http://linux-sxs.org/housekeeping/lscolors.html
引用

Here is an easy way to set different colours for different kinds of files when using the ls command.

Add the following lines to the bottom of your ~/.bashrc file -

alias ls='ls --color'
LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
export LS_COLORS

The first line makes ls use the --color parameter by default, which tells ls to display files in different colours based on the setting of the LS_COLORS variable.

The second line is the tricky one, and what I have worked out so far has been by trial and error.? The parameters (di, fi, etc.) refer to different Linux file types. I have worked them out as shown

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).

The *.rpm=90 parameter at the end tells ls to display any files ending in .rpm in the specified colour, in this case colour 90 (dark grey). This can be applied to any types of files (eg. you could use '*.png=35' to make jpeg files appear purple.) As many or as few parameters as you like can go into the LS_COLORS variable, as long as the parameters are separated by colons.

Using trial and error (and a little bash script I wrote... my first one ever! I worked out all the colour codes, at least my interpretation of them -

0?? = default colour
1?? = bold
4?? = underlined
5?? = flashing text
7?? = reverse field
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
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

These can even be combined, so that a parameter like:
di=5;31;42
in your LS_COLORS variable would make directories appear in flashing red text with a green background!

Setting LS_COLORS does more than just make your ls listings look pretty (although it certainly does do that), it is also very helpful in identifying files while wading through a file system.

If anyone finds out additional info on LS_COLORS, or spots an error, please e-mail me, I would like to know. Any questions may also be directed to me by e-mail.

ls colours


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲天天做日日摸天天做 | 国产婷婷综合在线视频中 | 欧美日韩高清在线 | 国产色婷婷精品免费视频 | 亚洲精品一区henhen色 | 亚洲在线视频观看 | 久久精品国产99久久无毒不卡 | aaa一级黄色片 | 99在线观看视频 | 成年女人视频在线观看免费 | 伊人色综合网 | 亚洲精品中文字幕乱码三区一二 | 国产日韩久久 | 国产精品真实对白精彩久久 | 国产亚洲精品久久午夜 | 天天做天天看夜夜爽毛片 | 天天操夜夜噜 | 国产美女白丝袜精品_a不卡 | 国内精品久久久久影院亚洲 | 久久精品一区二区国产 | 欧美美女啪啪 | 天天久久综合网站 | 一级全黄色毛片 | 久久精品国产400部免费看 | 伊人成人久久 | 亚洲欧洲一二三区机械有限公司 | 国产99re在线观看只有精品 | 在线播放五十路乱中文 | 刺激videoschina偷拍 | 99尹人香蕉国产免费天天在线 | 成人久久久精品乱码一区二区三区 | 99国产精品欧美久久久久久影院 | 99精品免费观看 | 色综合小说天天综合网 | 九九精品视频在线观看九九 | 久久精品亚洲热综合一本奇米 | 色欧美在线视频 | 欧美成人免费tv在线播放 | 同性女女黄h片在线播放 | 在线观看 一区二区 麻豆 | 美女久久|