导航:首页 > 操作系统 > linux颜色

linux颜色

发布时间:2022-01-11 19:35:43

linux终端显示的各种颜色的名称都代表什么意思

下面是linux系统默认不同类型文件的颜色:

㈡ linux系统下如何显示关键字颜色

linux下设置ls命令显示文件、文件夹颜色:

1. LS_COLORS

用 dircolors -p 可以 看到缺省的颜色设置,包括各种颜色和“粗体”,下划线,闪烁等定义。

环境变量LS_COLORS时用来设置GNU ls的--color选项中的颜色的。

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 01;34 # directory

故,要设置ls的颜色,则在SHELL的配置文件(以下是tcsh的配置文件:.tcshrc,对于bash略有不同)中添加下面一行:

setenv LS_COLORS 'no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;35:*.cmd=01;35:*.exe=01;35:*.com=01;35:*.btm=01;35:*.bat=01;35:*.sh=01;35:*.csh=01;35:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'

即可,可以参照上面的英文自行配置。

另:/etc/DIR_COLORS 文件为系统默认颜色参数配置文件
如果想修改定义自己的颜色参数配置文件,请执行如下操作:
1) cp /etc/DIR_COLORS $HOME/.dir_colors
2) 修改中的颜色定义 $HOME/.dir_colors

2. CLICOLOR

# CLICOLOR是用来设置是否进行颜色的显示。CLI是Command Line Interface的缩写。
setenv CLICOLOR 1

# LSCOLORS是用来设置当CLICOLOR被启用后,各种文件类型的颜色
setenv LSCOLORS gxfxaxdxcxegedabagacad

LSCOLORS的值中每两个字母为一组,分别设置某个文件类型的文字颜色和背景颜色。LSCOLORS中一共11组颜色设置,按照先后顺序,分别对以下的文件类型进行设置:

directory
symbolic link
socket
pipe
executable
block special
character special
executable with setuid bit set
executable with setgid bit set
directory writable to others, with sticky bit
directory writable to others, without sticky bit
LSCOLORS中,字母代表的颜色如下:
a 黑色
b 红色
c 绿色
d 棕色
e 蓝色
f 洋红色
g 青色
h 浅灰色
A 黑色粗体
B 红色粗体
C 绿色粗体
D 棕色粗体
E 蓝色粗体
F 洋红色粗体
G 青色粗体
H 浅灰色粗体
x 系统默认颜色
所以,如果我们想把目录显示成红色,就可以把LSCOLORS设置为bxfxaxdxcxegedabagacad就可以了
////////////////////////////////////////////
LSCOLORS 的含义:

LSCOLORS The value of this variable describes what color to use
for which attribute when colors are enabled with
CLICOLOR. This string is a concatenation of pairs of the
format fb, where f is the foreground color and b is the
background color.

The color designators are as follows:

a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background

Note that the above are standard ANSI colors. The actual
display may differ depending on the color capabilities of
the terminal in use.

The order of the attributes are as follows:

1. directory
2. symbolic link
3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit set
9. executable with setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky
bit

The default is “exfxcxdxbxegedabagacad”, i.e. blue fore-
ground and default background for regular directories,
black foreground and red background for setuid executa-
bles, etc.

㈢ linux下字体颜色变化

安装的是vim-enhance包装好了,打vim /etc/passwd进去就有颜色了!

㈣ 怎么才可以弄成很漂亮的linux终端背景,和字体颜色

你说的是Linux终端字体颜色设置吧

教程:http://blog.csdn.net/yanghao23/article/details/6249291

个人建议:先分步写,最后合成,避免出错。

方括号颜色:[e[0;37;40m]

显示方括号:[

用户名颜色:[e[1;32;40m]

显示用户名:u

冒号颜色:[e[1;32;40m]

显示冒号::

当前目录颜色:[e[1;36;40m]

显示当前目录:w

方括号颜色:[e[0;37;40m]

显示方括号:]

$符号颜色:[e[1;35;40m]

显示一个:$

最后空一格:

命令的颜色:[e[1;33;40m]

#写好后在.bashrc文件中添加PS1变量:
PS1="[e[0;37;40m][[e[1;32;40m]u:[e[1;36;40m]w[e[0;37;40m]][e[1;35;40m]$[e[1;33;40m]"

效果如图:

㈤ linux下文件和目录的颜色代表什么(,)

"蓝色表示目录;绿色表示可执行文件;红色表示压缩文件;
浅蓝
色表示链接文件;灰色表示其它文件;红色闪烁表示链接的文件有问题了;黄色是设备文件,包括block,
char,
fifo。
用dircolors
-p看到缺省的颜色设置,包括各种颜色和“粗体”,下划线,闪烁等定义。
可以多关.注《
Linux就该这么学
》这本书,我都是从这里面学到的
"

㈥ linux 文件夹的颜色代表什么意思

蓝色表示目录;
绿色表示可执行文件;
红色表示压缩文件;
浅蓝色表示链接文件;
灰色表示其它文件;
红色闪烁表示链接的文件有问题了;
黄色是设备文件,包括block, char, fifo。

㈦ linux下ls -color显示的是什么颜色

这个就说来话长了。ls作为linux的原始命令,是没有颜色之说的,不过现在多数环境下的ls都是包装过的,用ls时,都会有颜色区分。至于你说的-color,是错误的写法,应该是--color,color有三个取值{never, auto, always},也可以省略,如:ls --color=always。linux中参数有用'-'和'--'的,前者一般用的一个字符,后者接全称,所以是--color,而不是-color.

㈧ linux中颜色代表什么

蓝色表示目录;
绿色表示可执行文件;
红色表示压缩文件;
浅蓝色表示链接文件;
灰色表示其它文件;
红色闪烁表示链接的文件有问题了;
黄色是设备文件,包括block,
char,
fifo。

㈨ 怎样设置Linux里面的颜色

用 vim 写代码, 可以先按 ESC键,退出 INSERT 模式, 然后输入 ":syntax on", 引号里的内容都要输入,注意开始有个冒号。 设置完以后就是彩色的了。

㈩ linux 文件夹的颜色代表什么意思

白色: 普通文件
蓝色: 目录
绿色: 可执行文件
红色: 压缩文件
青色: 链接文件
棕色: 设备文件

阅读全文

与linux颜色相关的资料

热点内容
kafka删除topic命令 浏览:757
phpsql单引号 浏览:84
英雄联盟压缩壁纸 浏览:450
办公app需要什么服务器 浏览:626
安卓服务器怎么获得 浏览:806
空调压缩机冷媒的作用 浏览:779
淘宝app是以什么为利的 浏览:655
java提取图片文字 浏览:922
我的世界手机版指令复制命令 浏览:33
java判断字符串为数字 浏览:924
androidrpc框架 浏览:488
云服务器essd和ssd 浏览:522
家用网关的加密方式 浏览:1
怎么从ppt导出pdf文件 浏览:971
换汽车空调压缩机轴承 浏览:845
平板怎么登录安卓端 浏览:195
图像拼接计算法 浏览:255
怎么打开饥荒服务器的本地文件夹 浏览:291
usb扫描枪编程 浏览:673
博易大师手机app叫什么 浏览:663