W

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

· 19년 전 · 2715
제 .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>
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
19년 전 조회 2,118
19년 전 조회 3,569
19년 전 조회 2,580
19년 전 조회 2,755
19년 전 조회 4,378
19년 전 조회 3,559
19년 전 조회 2,317
19년 전 조회 4,304
19년 전 조회 3,281
19년 전 조회 4,145
19년 전 조회 2,006
19년 전 조회 2,219
19년 전 조회 2,148
19년 전 조회 3,357
19년 전 조회 2,727
19년 전 조회 3,516
19년 전 조회 2,693
19년 전 조회 2,531
19년 전 조회 2,352
19년 전 조회 2,244
19년 전 조회 2,131
19년 전 조회 4,262
19년 전 조회 2,684
19년 전 조회 2,166
19년 전 조회 2,269
19년 전 조회 2,853
19년 전 조회 1,969
19년 전 조회 3,208
19년 전 조회 2,772
19년 전 조회 2,278
19년 전 조회 1,819
19년 전 조회 2,244
19년 전 조회 2,019
19년 전 조회 1,915
19년 전 조회 2,474
19년 전 조회 2,330
19년 전 조회 3,894
19년 전 조회 3,748
19년 전 조회 2,252
19년 전 조회 3,293
19년 전 조회 1,964
19년 전 조회 2,390
19년 전 조회 2,286
19년 전 조회 2,350
19년 전 조회 2,187
19년 전 조회 2,829
19년 전 조회 2,829
19년 전 조회 3,178
19년 전 조회 3,052
19년 전 조회 2,716
19년 전 조회 2,935
19년 전 조회 3,182
19년 전 조회 2,886
19년 전 조회 2,621
19년 전 조회 2,934
19년 전 조회 4,514
19년 전 조회 2,435
19년 전 조회 2,455
19년 전 조회 3,496
19년 전 조회 3,161
19년 전 조회 2,815
19년 전 조회 2,057
19년 전 조회 1,788
19년 전 조회 2,887
19년 전 조회 1,731
19년 전 조회 2,321
19년 전 조회 3,963
19년 전 조회 3,744
19년 전 조회 3,462
19년 전 조회 3,411
19년 전 조회 1,575
19년 전 조회 1,946
19년 전 조회 1,867
19년 전 조회 2,533
19년 전 조회 4,626
19년 전 조회 2,764
19년 전 조회 1,931
19년 전 조회 1,939
19년 전 조회 1,824
19년 전 조회 2,569
19년 전 조회 8,186
19년 전 조회 2,733
19년 전 조회 2,802
19년 전 조회 3,050
19년 전 조회 2,206
19년 전 조회 2,224
19년 전 조회 2,187
19년 전 조회 2,077
19년 전 조회 2,266
19년 전 조회 2,521
19년 전 조회 3,093
19년 전 조회 2,340
19년 전 조회 1,917
19년 전 조회 2,843
19년 전 조회 5,013
19년 전 조회 3,504
19년 전 조회 3,462
19년 전 조회 2,984
19년 전 조회 2,404
19년 전 조회 1,497