導航:首頁 > 操作系統 > 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顏色相關的資料

熱點內容
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
刮眼影盤解壓方法 瀏覽:966