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