【问题标题】:Using GNU coreutils on iterm2 disables LSCOLORS在 iterm2 上使用 GNU coreutils 会禁用 LSCOLORS
【发布时间】:2020-12-21 00:41:02
【问题描述】:

我在 Mac OS Catalina 上使用 iterm2,但是,我更喜欢所有 GNU 实用程序而不是 FreeBSD 实用程序。具体来说,FreeBSD 中的cp 命令缺少用于指定目标的-t 选项,我喜欢在管道find | xargs cp -t <dest> 时使用它。

所以我使用 brew 来安装 GNU 核心实用程序,如本文所述:https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities

所以,我现在有了通用 shell 工具的 GNU 版本,我的 ls 现在正在使用 /usr/local/opt/coreutils/libexec/gnubin/ls。缺点是我的ls 颜色现在消失了。见下文:

env and command outputs

我显然可以通过将我的ls 命令与/bin/ls 别名来解决这个问题,但我想知道是否有更好的方法。如何让 GNU ls 识别我的颜色环境设置?

【问题讨论】:

    标签: gnu ls iterm2 ls-colors


    【解决方案1】:

    您需要使用 dircolors 来更改 coreutil ls 输出。此链接包含有关如何使用它的详细信息。 https://www.gnu.org/software/coreutils/manual/html_node/dircolors-invocation.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多