W

ls 명령에서 LS_COLOR 환경변수로 확장자별 색 바꾸기

· 2006-07-14 (금) 17:07:32 · 3754
제 .bashrc 중 일부분입니다.
---------------------------------------------------------------------------------------------
...
# 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
# LINK 01;36 # symbolic link
# FIFO 40;33 # pipe
# SOCK 01;35 # socket
# BLK 40;33;01 # block device driver
# CHR 40;33;01 # character device driver
# ORPHAN 01;05;37;41 # orphaned syminks
# MISSING 01;05;37;41 # ... and the files they point to

LS_COLORS="di=01;31:or=1;40;31:*.gz=1;35:*.bz2=1;35:*.tar=1;35:*.rpm=1;35:*.tgz=1;35:*.h=1;37:*.c=1;37:*.patch=1;37"
export LS_COLORS
...
---------------------------------------------------------------------------------------------


주석은 /etc/DIR_COLORS 에서 참고 했습니다.

제 설정을 설명하면,

규칙은 [특수파일|*.확장자]= [속성];[색]
이고, 구분자는 ":" 입니다.

di는 DIR의 단축 입니다.
or은 ORPHAN의 단축 이고요.

예 처럼주석에 나와있는 특수 파일에 대한 설정도 하실 수 있습니다.
위의 예를 .bashrc 에 넣으시고, 입맛에 맞게 색을 바꿔보세요.<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
06-07-11 조회 3,520
06-07-11 조회 3,520
06-07-11 조회 4,574
06-07-11 조회 4,288
06-07-11 조회 3,881
06-07-11 조회 3,100
06-07-11 조회 2,853
06-07-11 조회 3,962
06-07-11 조회 2,835
06-07-11 조회 3,412
06-07-11 조회 5,012
06-07-11 조회 4,804
06-07-11 조회 4,487
06-07-11 조회 4,486
06-07-11 조회 2,612
06-07-11 조회 2,974
06-07-11 조회 2,912
06-07-11 조회 3,596
06-07-11 조회 5,762
06-07-11 조회 3,821
06-07-11 조회 2,952
06-07-11 조회 2,966
06-07-11 조회 2,870
06-07-11 조회 3,633
06-07-11 조회 9,251
06-07-11 조회 3,784
06-07-11 조회 3,827
06-07-11 조회 4,098
06-07-11 조회 3,330
06-07-11 조회 3,379
06-07-11 조회 3,325
06-07-11 조회 3,123
06-07-11 조회 3,415
06-07-11 조회 3,545
06-07-07 조회 4,166
06-07-05 조회 3,361
06-07-05 조회 3,037
06-07-02 조회 3,884
06-06-29 조회 6,124
06-06-27 조회 4,614
06-06-25 조회 4,510
06-06-24 조회 4,029
06-06-24 조회 3,486
06-06-22 조회 2,554
06-06-21 조회 4,281
06-06-21 조회 3,085
06-06-19 조회 6,497
06-06-16 조회 3,472
06-06-15 조회 4,500
06-06-15 조회 3,976
06-06-14 조회 2,901
06-06-14 조회 4,995
06-06-14 조회 3,504
06-06-14 조회 3,343
06-06-13 조회 4,107
06-06-13 조회 4,424
06-06-13 조회 3,527
06-06-13 조회 3,332
06-06-13 조회 3,331
06-06-12 조회 3,037
06-06-12 조회 4,143
06-06-12 조회 3,099
06-06-12 조회 3,137
06-06-12 조회 2,763
06-06-12 조회 3,327
06-06-11 조회 3,241
06-06-11 조회 3,597
06-06-10 조회 3,970
06-06-10 조회 3,432
06-06-09 조회 3,559
06-06-09 조회 4,520
06-06-08 조회 4,342
06-06-08 조회 4,255
06-06-08 조회 4,098
06-06-08 조회 3,112
06-06-08 조회 3,435
06-06-08 조회 3,298
06-06-08 조회 3,089
06-06-08 조회 3,542
06-06-08 조회 3,431
06-06-08 조회 3,851
06-06-08 조회 3,232
06-06-08 조회 4,504
06-06-07 조회 3,025
06-06-07 조회 3,728
06-06-07 조회 2,649
06-06-05 조회 3,944
06-06-05 조회 4,117
06-06-05 조회 3,217
06-06-05 조회 3,074
06-06-02 조회 3,522
06-06-02 조회 3,558
06-06-01 조회 4,189
06-06-01 조회 7,848
06-06-01 조회 3,805
06-05-31 조회 4,295
06-05-31 조회 4,207
06-05-31 조회 3,007
06-05-31 조회 4,429
06-05-31 조회 3,298