如何关闭 OSX 终端中 ls 输出的颜色
How do I turn OFF colors for ls output in Terminal on OSX
我的 ls
输出颜色所有目录与文件不同,无论我输入 ls
还是 /bin/ls
。我没有在 .bashrc
中设置任何 LS_COLOR
内容或我能找到的相关文件。
如何关闭关闭这些颜色? (我很满意 ls -F
)
谢谢!
如评论中所述,OSX ls
关注 CLICOLOR
。 ls
manual page is the place to look. It appears to be the same program as in FreeBSD,它使用终端数据库(与 GNU ls 相反)。同样,请注意变量是 LSCOLORS
,而不是 LS_COLORS
:
CLICOLOR
Use ANSI color sequences to distinguish file types. See LSCOLORS
below. In addition
to the file types mentioned in the -F option some extra attributes (setuid bit set,
etc.) are also displayed. The colorization is dependent on a terminal type with the
proper termcap(5) capabilities. The default “cons25” console has the proper capabilities,
but to display the colors in an xterm(1), for example, the TERM variable must be
set to “xterm-color”. Other terminal types may require similar adjustments. Colorization
is silently disabled if the output isn't directed to a terminal unless the CLICOLOR_FORCE
variable is defined.
CLICOLOR_FORCE
Color sequences are normally disabled if the output isn't directed to a terminal. This
can be overridden by setting this flag. The TERM
variable still needs to reference a
color capable terminal however otherwise it is not possible to determine which color
sequences to use.
TERM
The CLICOLOR
functionality depends on a terminal type with color capabilities.
关于"termcap(5)"的措辞已经过时; FreeBSD 和 OSX 都使用 terminfo 数据库超过十年。
GNU ls manual page does say LS_COLORS
(the two are not the same). The dircolors
manual 页面对 "precompiled database" 进行了倾斜引用(这与 terminfo/termcap 无关,它使用 TERM
获得类似的结果是混淆的来源)。
我的 ls
输出颜色所有目录与文件不同,无论我输入 ls
还是 /bin/ls
。我没有在 .bashrc
中设置任何 LS_COLOR
内容或我能找到的相关文件。
如何关闭关闭这些颜色? (我很满意 ls -F
)
谢谢!
如评论中所述,OSX ls
关注 CLICOLOR
。 ls
manual page is the place to look. It appears to be the same program as in FreeBSD,它使用终端数据库(与 GNU ls 相反)。同样,请注意变量是 LSCOLORS
,而不是 LS_COLORS
:
CLICOLOR
Use ANSI color sequences to distinguish file types. See
LSCOLORS
below. In addition to the file types mentioned in the -F option some extra attributes (setuid bit set, etc.) are also displayed. The colorization is dependent on a terminal type with the proper termcap(5) capabilities. The default “cons25” console has the proper capabilities, but to display the colors in an xterm(1), for example, the TERM variable must be set to “xterm-color”. Other terminal types may require similar adjustments. Colorization is silently disabled if the output isn't directed to a terminal unless theCLICOLOR_FORCE
variable is defined.
CLICOLOR_FORCE
Color sequences are normally disabled if the output isn't directed to a terminal. This can be overridden by setting this flag. The
TERM
variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use.
TERM
The
CLICOLOR
functionality depends on a terminal type with color capabilities.
关于"termcap(5)"的措辞已经过时; FreeBSD 和 OSX 都使用 terminfo 数据库超过十年。
GNU ls manual page does say LS_COLORS
(the two are not the same). The dircolors
manual 页面对 "precompiled database" 进行了倾斜引用(这与 terminfo/termcap 无关,它使用 TERM
获得类似的结果是混淆的来源)。