-1

I'm on Oracle Linux.

[root@ol76 systemd]# cat /etc/*release*
Oracle Linux Server release 7.6
NAME="Oracle Linux Server"
VERSION="7.6"
ID="ol"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Oracle Linux Server 7.6"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:6:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.6
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.6
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Oracle Linux Server release 7.6
cpe:/o:oracle:linux:7:6:server
[root@ol76 systemd]#

Why the result of ls has highlighting, but dir doesn't?

enter image description here

5
  • dir --color=auto Commented Aug 12, 2019 at 16:05
  • Yes, that works. Thank you. Could you make it as an answer so that I can accept? Commented Aug 12, 2019 at 16:07
  • I just found ls also has color parameter. alias ls='ls --color=auto' Commented Aug 12, 2019 at 16:08
  • Done it. Sorry for the spanish, I can't change my LC_ALL to english, but I provide some translation :) Commented Aug 12, 2019 at 16:21
  • 1
    @guillermochamorro LC_ALL=C dir --help Commented Aug 12, 2019 at 16:23

1 Answer 1

1

From dir --help:

Using color to distinguish file types is disabled both by default and with --color=never. With --color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors command to set it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.