ls 명령에서 LS_COLOR 환경변수로 확장자별 색 바꾸기
제 .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>
---------------------------------------------------------------------------------------------
...
# 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>
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 716 | PHP |
|
19년 전 | 3870 | |
| 715 | PHP |
|
19년 전 | 4158 | |
| 714 | 기타 |
|
19년 전 | 3798 | |
| 713 | 기타 |
|
19년 전 | 3842 | |
| 712 | 기타 |
|
19년 전 | 3605 | |
| 711 | Linux |
|
19년 전 | 4158 | |
| 710 | MySQL |
|
19년 전 | 3812 | |
| 709 | JavaScript | 19년 전 | 2907 | ||
| 708 | 기타 | 19년 전 | 3970 | ||
| 707 | JavaScript |
|
19년 전 | 3239 | |
| 706 | 기타 |
|
19년 전 | 2832 | |
| 705 | MySQL |
|
19년 전 | 13875 | |
| 704 | Flash |
|
19년 전 | 5458 | |
| 703 | JavaScript |
|
19년 전 | 3642 | |
| 702 | 기타 | 19년 전 | 3055 | ||
| 701 | JavaScript | 19년 전 | 3294 | ||
| 700 | JavaScript | 19년 전 | 3162 | ||
| 699 | 기타 |
Power
|
19년 전 | 3544 | |
| 698 | JavaScript | 19년 전 | 3214 | ||
| 697 | JavaScript |
pearly
|
19년 전 | 5427 | |
| 696 | 기타 |
pearly
|
19년 전 | 4563 | |
| 695 | 기타 |
pearly
|
19년 전 | 4759 | |
| 694 | JavaScript |
pearly
|
19년 전 | 3856 | |
| 693 | PHP | 19년 전 | 4075 | ||
| 692 | JavaScript |
|
19년 전 | 3482 | |
| 691 | JavaScript |
pearly
|
19년 전 | 3819 | |
| 690 | 기타 | 19년 전 | 3443 | ||
| 689 | 기타 |
pearly
|
19년 전 | 4788 | |
| 688 | 기타 | 19년 전 | 4440 | ||
| 687 | 기타 |
|
19년 전 | 3064 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기