Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ls 명령 시 나타나는 결과에 대한 색상을 제어하기 위한 내용입니다.

ls 버전 중에서  --color 옵션을 사용할 수 있는 버전은 파일 이름(확장자)이나 형태에 따라서  파일 목록을 색깔별로 나열할 수 있습니다.

컬러화의 초기값은 파일 형태에 따른 것이지만 환경 변수The following are instructions for controlling the colors that appear when using the ls command.

The ls version which can utilize the --color option can list files by color depending on the filename(extension) or the file type.

Colors initially depend on the file type, but this can be changed using the environment variable "LS_COLORS(또는 or LS_COLOURS)."로 변경할 수 있습니다.


1. Environment variable type

...

Panel

LS_COLORS='type:type:type:...'

항목의 형식은The item format is 'xx=string' 입니다.xx는 파일의 형태를 나타내는 두 개의 문자이고, 문자열은 ';'로 구분하여 값(속성 및 색깔)을 정할 수 있습니다

xx represents the two character file type. Strings can be separated by ';' to define values (properties and colors).


2. File type

...

위 1의 xx에 해당하는 문자입니다The following represent the xx characters described in step 1.


noPlain text, not filename
fiNormal file
diDirectory
lnSymbolic link
piFIFO(Pipe)
soSocket
bdBlock device
cdCharacter device
exExecution file
miLost file (default is fi)
orFiles without symbolic link targets (default is ln)
suSETUID setting file(u+s)
sgSETGID setting file(g+s)
twSTICKY 비트이고 다른 사용자(other) 쓰기 가능인 디렉토리Other user writable Sticky bit directories(+t, o+w)
ow다른 사용자(other) 쓰기 가능(Other user writable directories (o+w) 이지만 STICKY 비트는 아닌 디렉토리but not Sticky bit(-t, o+w).
stSTICKY 비트이지만 다른 사용자 쓰기 가능이 아닌 디렉토리Non other user writable Sticky bit directories(+t, o-w)


You can also use the '*' 문자를 사용하여 일반 파일명에도 적용할 수 있습니다. 주로 확장자에 대한 색깔을 표현할 때 사용합니다.형식은  character to apply to regular file names. It is typically used to express extension colors.

The format is '*filename=string' 입니다.


Example)

*.tar=00;31 => 확장자가 tar 파일은 전경색을 빨강(두번째 색) 전경으로 나타냅니다 Files with the tar extension are displayed as red (second color).

*README=01:32 => README 파일은 전경색을 강조 속성과 녹색(세번째 색)으로 나타냅니다 The README file is displayed as highlighted and green (third color).




3. Properties and Colors

...


배경
속성Attribute
00Reset
01Highlight color
04Underline
05Blinking text
07Inverse
05Hide
전경Foreground
30첫번째 색First color (ANSI 컬러일 경우 검정color black)
31두번째 색Second color (ANSI 컬러일 경우 빨강color red)
32세번째 색Third color (ANSI 컬러일 경우 녹색color green)
33네번째 색Fourth color (ANSI 컬러일 경우 노랑(또는 갈색))color yellow or brown)
34다섯번째 색Fifth color (ANSI 컬러일 경우 파랑color blue)
35여섯번째 색Sixth color (ANSI 컬러일 경우 보라color purple)
36일곱번째 색Seventh color (ANSI 컬러일 경우 청록색color cyan)
37여덟번째 색(ANSI 컬러일 경우 흰색(또는 회색))Eighth color (ANSI color white or gray)
Background
40첫번째 색First color (ANSI 컬러일 경우 검정color black)
41두번째 색Second color (ANSI 컬러일 경우 빨강color red)
42세번째 색Third color (ANSI 컬러일 경우 녹색color green)
43네번째 색(ANSI 컬러일 경우 노랑(또는 갈색)Fourth color (ANSI color yellow or brown)
44다섯번째 색Fifth color (ANSI 컬러일 경우 파랑color blue)
45여섯번째 색Sixth color (ANSI 컬러일 경우 보라color purple)
46일곱번째 색Seventh color (ANSI 컬러일 경우 청록색color cyan)
47여덟번째 색Eighth color (ANSI 컬러일 경우 흰색(또는 회색))color white or gray)



4. Color representation in Xshell

...

Xshell에서 ls 명령 시 표현하기 위해서는 우선 아래 글을 참조하십시오.Please see the following link for ls command color representations in Xshell,


Info
titleRelative Link

Xshell에는 터미널에 나타나는 색을 사용자가 정할 수 있는 기능이 있습니다.

위 3의 전경색과 배경색은 Xshell의 색 구성표에 있는 컬러 순서에 따릅니다.

...


Xshell has a feature that allows users to specify colors that appear in the terminal.

The foreground and background colors listed in step 3 follow the color orders in Xshell's color scheme.



5. Examples in XSHELL


  • fi=00: => 일반 파일은 속성 없음 Regular files have no attribute.
  • di=01;34: => 디렉토리는 강조색 네번째 색(밝은 파랑 Directories are highlighted and the fifth color (light blue)
  • ln=01;36: => 심볼릭 링크 파일은 강조색 여섯번째 색(밝은 청록색 Symbolic link files are highlighted and the seventh color (light cyan)
  • or=31;40: => 링크를 상실한 심볼릭 링크 파일은 빨강색 글자에 배경은 검정 Symbolic link files with a lost link are displayed in red with a black background
  • ex=01;32: => 실행파일은 글자가 강조색 세번째 색(밝은 녹색). Executable files are highlighted and the third color (light green)
  • *.tar=01;31 => 확장자가 tar인 파일은 강조색 두번째 색(밝은 빨강)

...

  •  Files with the tar extension are the second color (red)

In the color scheme's ANSI color Xshell uses the first line's color for regular characters and the second line's color for emphasis (bold) characters.