W

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

· 19년 전 · 2709
제 .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,114
19년 전 조회 3,563
19년 전 조회 2,573
19년 전 조회 2,751
19년 전 조회 4,372
19년 전 조회 3,555
19년 전 조회 2,311
19년 전 조회 4,299
19년 전 조회 3,273
19년 전 조회 4,139
19년 전 조회 2,000
19년 전 조회 2,214
19년 전 조회 2,144
19년 전 조회 3,351
19년 전 조회 2,720
19년 전 조회 3,509
19년 전 조회 2,686
19년 전 조회 2,523
19년 전 조회 2,346
19년 전 조회 2,235
19년 전 조회 2,125
19년 전 조회 4,252
19년 전 조회 2,679
19년 전 조회 2,159
19년 전 조회 2,261
19년 전 조회 2,845
19년 전 조회 1,961
19년 전 조회 3,199
19년 전 조회 2,760
19년 전 조회 2,268
19년 전 조회 1,813
19년 전 조회 2,235
19년 전 조회 2,012
19년 전 조회 1,907
19년 전 조회 2,464
19년 전 조회 2,320
19년 전 조회 3,884
19년 전 조회 3,742
19년 전 조회 2,244
19년 전 조회 3,283
19년 전 조회 1,957
19년 전 조회 2,383
19년 전 조회 2,279
19년 전 조회 2,344
19년 전 조회 2,178
19년 전 조회 2,817
19년 전 조회 2,822
19년 전 조회 3,170
19년 전 조회 3,041
19년 전 조회 2,710
19년 전 조회 2,926
19년 전 조회 3,179
19년 전 조회 2,876
19년 전 조회 2,613
19년 전 조회 2,927
19년 전 조회 4,506
19년 전 조회 2,428
19년 전 조회 2,448
19년 전 조회 3,487
19년 전 조회 3,157
19년 전 조회 2,807
19년 전 조회 2,050
19년 전 조회 1,778
19년 전 조회 2,881
19년 전 조회 1,724
19년 전 조회 2,312
19년 전 조회 3,955
19년 전 조회 3,734
19년 전 조회 3,455
19년 전 조회 3,405
19년 전 조회 1,569
19년 전 조회 1,937
19년 전 조회 1,859
19년 전 조회 2,524
19년 전 조회 4,621
19년 전 조회 2,756
19년 전 조회 1,922
19년 전 조회 1,929
19년 전 조회 1,818
19년 전 조회 2,563
19년 전 조회 8,179
19년 전 조회 2,727
19년 전 조회 2,794
19년 전 조회 3,042
19년 전 조회 2,198
19년 전 조회 2,216
19년 전 조회 2,179
19년 전 조회 2,069
19년 전 조회 2,261
19년 전 조회 2,516
19년 전 조회 3,083
19년 전 조회 2,334
19년 전 조회 1,908
19년 전 조회 2,833
19년 전 조회 5,002
19년 전 조회 3,498
19년 전 조회 3,456
19년 전 조회 2,976
19년 전 조회 2,398
19년 전 조회 1,491