1

I have tried both

 ls --color=auto

and

 ls -G

The first gives ls: illegal option -- - and the second simply has no effect. So then what is the way to get color for ls on macOS? I am using the default bash on catalina

I am using the standard Terminal.app

$echo $TERM  
vt100 
3
  • 1
    -G should do it (check man ls for details); if it doesn't, something else is blocking it. What Terminal program are you using, and what does echo "$TERM" print? Commented May 1, 2021 at 21:32
  • standard Terminal.app . $echo $TERM vt100 Commented May 1, 2021 at 21:39
  • apple.stackexchange.com/a/125076/37797
    – grg
    Commented May 1, 2021 at 22:49

1 Answer 1

4

You'll want to open the Preferences window in Terminal.app. Turn to the Profiles tab, and then the Advanced tab. You'll see that it says "Declare terminal as", which you would have set to vt100. Change this to xterm-256color.

Now you can run ls -G to see a coloured ls output.

Not the answer you're looking for? Browse other questions tagged .