W

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

· 2006-07-14 (금) 17:07:32 · 3740
제 .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-12-15 조회 4,497
06-12-15 조회 2,915
06-12-15 조회 3,205
06-12-15 조회 3,057
06-12-15 조회 2,995
06-12-15 조회 2,768
06-12-15 조회 4,413
06-12-15 조회 2,883
06-12-15 조회 3,040
06-12-15 조회 2,656
06-12-15 조회 3,306
06-12-15 조회 3,569
06-12-15 조회 2,825
06-12-15 조회 2,961
06-12-12 조회 3,326
06-12-11 조회 4,446
06-12-10 조회 4,091
06-12-07 조회 3,615
06-12-07 조회 3,891
06-11-30 조회 3,152
06-11-27 조회 5,499
06-11-11 조회 3,191
06-10-16 조회 3,716
06-10-10 조회 3,399
06-09-27 조회 9,034
06-09-26 조회 4,196
06-09-21 조회 3,851
06-09-21 조회 3,453
06-09-21 조회 4,310
06-09-21 조회 4,270
06-09-21 조회 3,608
06-09-21 조회 3,816
06-09-21 조회 3,654
06-09-21 조회 4,424
06-09-21 조회 4,621
06-09-18 조회 3,538
06-09-15 조회 3,533
06-09-15 조회 3,395
06-09-11 조회 3,680
06-09-11 조회 3,428
06-09-11 조회 3,640
06-09-11 조회 4,990
06-09-11 조회 4,486
06-09-06 조회 3,114
06-09-04 조회 3,854
06-09-02 조회 4,054
06-09-01 조회 4,142
06-08-28 조회 4,340
06-08-27 조회 3,393
06-08-27 조회 2,721
06-08-27 조회 2,621
06-08-27 조회 3,241
06-08-27 조회 2,904
06-08-27 조회 2,968
06-08-27 조회 6,380
06-08-27 조회 2,590
06-08-27 조회 2,517
06-08-24 조회 4,710
06-08-23 조회 2,974
06-08-22 조회 2,914
06-08-22 조회 2,887
06-08-19 조회 3,036
06-08-12 조회 2,995
06-08-11 조회 4,216
06-08-08 조회 3,000
06-08-06 조회 3,373
06-08-05 조회 2,813
06-08-04 조회 3,289
06-08-04 조회 4,243
06-08-03 조회 3,472
06-07-25 조회 3,571
06-07-23 조회 3,369
06-07-22 조회 4,405
06-07-21 조회 3,044
06-07-21 조회 3,250
06-07-21 조회 3,213
06-07-20 조회 4,529
06-07-20 조회 5,341
06-07-20 조회 3,907
06-07-19 조회 4,345
06-07-19 조회 3,275
06-07-19 조회 4,931
06-07-19 조회 4,331
06-07-19 조회 3,450
06-07-12 조회 3,963
06-07-11 조회 5,595
06-07-11 조회 4,275
06-07-11 조회 2,821
06-07-11 조회 4,468
06-07-11 조회 3,581
06-07-11 조회 3,813
06-07-11 조회 2,956
06-07-11 조회 2,853
06-07-11 조회 3,534
06-06-27 조회 4,597
06-06-21 조회 4,278
06-06-15 조회 3,968
06-06-10 조회 3,412
06-06-05 조회 3,205
06-05-31 조회 4,283