W

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

· 19년 전 · 2825
제 .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,234
19년 전 조회 3,685
19년 전 조회 2,687
19년 전 조회 2,872
19년 전 조회 4,495
19년 전 조회 3,669
19년 전 조회 2,439
19년 전 조회 4,428
19년 전 조회 3,403
19년 전 조회 4,265
19년 전 조회 2,134
19년 전 조회 2,334
19년 전 조회 2,263
19년 전 조회 3,474
19년 전 조회 2,846
19년 전 조회 3,632
19년 전 조회 2,809
19년 전 조회 2,637
19년 전 조회 2,466
19년 전 조회 2,362
19년 전 조회 2,249
19년 전 조회 4,387
19년 전 조회 2,799
19년 전 조회 2,279
19년 전 조회 2,383
19년 전 조회 2,966
19년 전 조회 2,081
19년 전 조회 3,329
19년 전 조회 2,885
19년 전 조회 2,393
19년 전 조회 1,926
19년 전 조회 2,370
19년 전 조회 2,137
19년 전 조회 2,025
19년 전 조회 2,583
19년 전 조회 2,441
19년 전 조회 4,017
19년 전 조회 3,864
19년 전 조회 2,370
19년 전 조회 3,413
19년 전 조회 2,077
19년 전 조회 2,505
19년 전 조회 2,396
19년 전 조회 2,461
19년 전 조회 2,305
19년 전 조회 2,933
19년 전 조회 2,945
19년 전 조회 3,283
19년 전 조회 3,155
19년 전 조회 2,826
19년 전 조회 3,044
19년 전 조회 3,287
19년 전 조회 2,998
19년 전 조회 2,731
19년 전 조회 3,060
19년 전 조회 4,636
19년 전 조회 2,538
19년 전 조회 2,570
19년 전 조회 3,609
19년 전 조회 3,280
19년 전 조회 2,928
19년 전 조회 2,167
19년 전 조회 1,910
19년 전 조회 2,997
19년 전 조회 1,854
19년 전 조회 2,431
19년 전 조회 4,073
19년 전 조회 3,854
19년 전 조회 3,579
19년 전 조회 3,526
19년 전 조회 1,685
19년 전 조회 2,056
19년 전 조회 1,969
19년 전 조회 2,656
19년 전 조회 4,738
19년 전 조회 2,883
19년 전 조회 2,037
19년 전 조회 2,048
19년 전 조회 1,940
19년 전 조회 2,681
19년 전 조회 8,293
19년 전 조회 2,853
19년 전 조회 2,908
19년 전 조회 3,173
19년 전 조회 2,316
19년 전 조회 2,335
19년 전 조회 2,293
19년 전 조회 2,182
19년 전 조회 2,373
19년 전 조회 2,631
19년 전 조회 3,197
19년 전 조회 2,446
19년 전 조회 2,025
19년 전 조회 2,953
19년 전 조회 5,122
19년 전 조회 3,612
19년 전 조회 3,568
19년 전 조회 3,098
19년 전 조회 2,520
19년 전 조회 1,608