在终端(或iTerm2)中的可执行文件上更改颜色 [英] Change colors on executable files in the terminal (or iTerm2)

查看:886
本文介绍了在终端(或iTerm2)中的可执行文件上更改颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改它,以便与其他文件相比,可执行文件没有其他颜色?我使用的是macOS Sierra(10.12.6).都是一样的,都在常规终端中:

How do I change it, so executable files don't have another color, compared to other files? I'm on macOS Sierra (10.12.6). It's the same, both in the regular Terminal:

...或在iTerm2中:

... or in iTerm2:

令人沮丧.如果我写chmod -x [FILENAME],它就会消失.但是我不想更改文件是否可执行,-我想更改可执行文件的颜色.我希望我的文件看起来像这样(无论它是否可执行):

It's frustating to look at. If i write chmod -x [FILENAME] then it disappears. But I don't want to change if the files are executable or not, - I want to change the color of executable files. I want my files to look like this (regardless of if it's executable or not):

推荐答案

我尝试更正Anshuman的答案,因此它可以帮助面临潜在挑战的人们.他的回答为我指明了正确的方向,但距离问题的答案还很遥远.所以我自己将其发布在这里.

I tried correcting Anshuman's answer, so it could help people with the potential same challenges. His answer pointed me in the right direction, but was pretty far from the answer to the question. So I'll post it here myself.

LSCOLORS在您的环境的~/.bash_profile(或~/.zshrc-文件,如果使用Zshell)中设置. 在此页面上,然后您可以尝试一下设置,看看哪些字母会更改哪种颜色.在您当前的LSCOLORS中,它将可执行文件的颜色设置为另一种颜色.查找(更改)该颜色的方法如下:

The LSCOLORS are set in your ~/.bash_profile (or ~/.zshrc-file, if you use Zshell) for your environment. On this page, then you can experiment a bit with the settings and see which letters changes which colors. It's in your current LSCOLORS that it's setting the color of your executable files to be another color. Here's how you find (and change) that color:

转到您的终端并输入:

echo $LSCOLORS

然后它将打印出您当前的设置,可能与以下内容类似:

then it'll print out your current setup, which might be something along these lines:

Gxfxcxdxbxegedabagacad

如果您然后(在这种情况下)将其更改为此:

If you then (in this case) change it to this:

GxfxcxdxDxegedabagacad

然后它将更改可执行文件的颜色.改变的根源在于您的个人资料中的颜色,它指向:

Then it would change the colors of the executable files. And what that change comes down to, is which color in your profile, it's pointing to:

这篇关于在终端(或iTerm2)中的可执行文件上更改颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆