How to get colors from 'ls' command on macOS [duplicate]

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 

Solution 1:

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.