W

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

· 19년 전 · 2788
제 .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,196
19년 전 조회 3,650
19년 전 조회 2,661
19년 전 조회 2,845
19년 전 조회 4,458
19년 전 조회 3,632
19년 전 조회 2,408
19년 전 조회 4,392
19년 전 조회 3,371
19년 전 조회 4,229
19년 전 조회 2,099
19년 전 조회 2,302
19년 전 조회 2,231
19년 전 조회 3,431
19년 전 조회 2,814
19년 전 조회 3,602
19년 전 조회 2,774
19년 전 조회 2,605
19년 전 조회 2,432
19년 전 조회 2,321
19년 전 조회 2,212
19년 전 조회 4,347
19년 전 조회 2,765
19년 전 조회 2,242
19년 전 조회 2,342
19년 전 조회 2,937
19년 전 조회 2,043
19년 전 조회 3,286
19년 전 조회 2,846
19년 전 조회 2,354
19년 전 조회 1,883
19년 전 조회 2,335
19년 전 조회 2,101
19년 전 조회 1,983
19년 전 조회 2,549
19년 전 조회 2,404
19년 전 조회 3,979
19년 전 조회 3,820
19년 전 조회 2,335
19년 전 조회 3,381
19년 전 조회 2,044
19년 전 조회 2,467
19년 전 조회 2,354
19년 전 조회 2,424
19년 전 조회 2,266
19년 전 조회 2,895
19년 전 조회 2,910
19년 전 조회 3,242
19년 전 조회 3,117
19년 전 조회 2,789
19년 전 조회 3,011
19년 전 조회 3,251
19년 전 조회 2,963
19년 전 조회 2,693
19년 전 조회 3,021
19년 전 조회 4,594
19년 전 조회 2,510
19년 전 조회 2,531
19년 전 조회 3,569
19년 전 조회 3,236
19년 전 조회 2,894
19년 전 조회 2,131
19년 전 조회 1,872
19년 전 조회 2,962
19년 전 조회 1,812
19년 전 조회 2,393
19년 전 조회 4,035
19년 전 조회 3,815
19년 전 조회 3,534
19년 전 조회 3,487
19년 전 조회 1,647
19년 전 조회 2,012
19년 전 조회 1,934
19년 전 조회 2,609
19년 전 조회 4,697
19년 전 조회 2,845
19년 전 조회 2,008
19년 전 조회 2,009
19년 전 조회 1,901
19년 전 조회 2,645
19년 전 조회 8,261
19년 전 조회 2,817
19년 전 조회 2,869
19년 전 조회 3,138
19년 전 조회 2,278
19년 전 조회 2,295
19년 전 조회 2,259
19년 전 조회 2,147
19년 전 조회 2,337
19년 전 조회 2,600
19년 전 조회 3,163
19년 전 조회 2,409
19년 전 조회 1,987
19년 전 조회 2,910
19년 전 조회 5,087
19년 전 조회 3,578
19년 전 조회 3,529
19년 전 조회 3,060
19년 전 조회 2,481
19년 전 조회 1,567