W

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

· 2006-07-14 (금) 17:07:32 · 3683
제 .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건
+
제목 글쓴이 날짜 조회
07-10-13 조회 5,106
07-10-03 조회 4,097
07-10-03 조회 3,285
07-10-03 조회 2,504
07-10-03 조회 4,609
07-10-02 조회 2,944
07-10-01 조회 3,571
07-09-28 조회 3,488
07-09-27 조회 4,549
07-08-16 조회 6,403
07-08-04 조회 2,852
07-07-25 조회 6,106
07-07-05 조회 4,000
07-07-02 조회 4,547
07-06-30 조회 4,446
07-06-20 조회 7,335
07-06-20 조회 3,944
07-06-05 조회 4,116
07-05-26 조회 3,142
07-05-17 조회 9,151
07-05-17 조회 5,193
07-05-04 조회 6,114
07-04-15 조회 6,201
07-04-13 조회 3,965
07-04-11 조회 3,385
07-03-20 조회 3,556
07-03-02 조회 6,784
07-02-27 조회 6,046
07-02-22 조회 4,443
07-01-30 조회 6,252
07-01-30 조회 1만
06-12-20 조회 3,722
06-12-18 조회 4,603
06-12-15 조회 4,583
06-12-15 조회 3,810
06-12-15 조회 3,195
06-11-30 조회 3,636
06-11-27 조회 4,527
06-10-24 조회 6,438
06-10-17 조회 4,750
06-09-22 조회 4,485
06-09-21 조회 5,989
06-09-21 조회 3,913
06-09-15 조회 6,533
06-08-20 조회 3,673
06-07-19 조회 3,314
06-07-14 조회 4,220
06-07-14 조회 4,087
06-07-11 조회 5,698
06-06-08 조회 4,275
06-06-08 조회 4,187
06-05-24 조회 3,498
06-05-24 조회 4,885
06-05-17 조회 3,593
06-05-16 조회 4,345
06-05-14 조회 6,039
06-05-12 조회 3,598
06-05-06 조회 4,245
06-05-06 조회 4,330
06-05-06 조회 3,629
06-05-06 조회 3,700
06-05-06 조회 4,150
06-04-25 조회 4,016
06-03-23 조회 5,475
06-01-20 조회 4,043
06-01-04 조회 4,250
05-12-30 조회 4,122
05-12-21 조회 4,797
05-11-09 조회 4,005
05-11-09 조회 3,785
05-10-09 조회 3,450
05-09-21 조회 6,838
05-08-14 조회 4,318
05-08-04 조회 5,502
05-07-14 조회 4,558
05-06-15 조회 4,946
05-04-23 조회 4,552
05-04-20 조회 5,008
05-04-19 조회 1.1만
05-04-19 조회 5,969
05-03-15 조회 3,785
05-03-15 조회 4,228
05-03-13 조회 2,905
05-03-13 조회 3,430
05-03-13 조회 3,418
05-03-13 조회 2,719
05-03-13 조회 5,765
05-03-13 조회 5,402
05-03-13 조회 4,334
05-03-13 조회 4,629
05-03-13 조회 7,890
05-03-13 조회 4,388
05-03-13 조회 3,470
05-03-13 조회 3,464
05-03-13 조회 8,012
05-03-13 조회 5,467
05-03-13 조회 4,117
05-03-12 조회 3,755
05-03-12 조회 4,469
05-02-24 조회 4,618