I'm using a Mac Silicon with the Ventura MacOS. In the Terminal app, all the file names have the same color. Take note that the default shell is zsh in Ventura, and is the one I want to use. Currently, my .zshrc config file has this content (so the directories are all shown with some color in the Terminal. I don't want to change this):
PROMPT='%U%B%F{red}%n%u: ~%f%b'
alias ls="ls -G"
alias ll="ls -lG"
The -G
option in BSD ls
(also used on macOS) turns on colored output.
I would like to add something in there to change the color used to display hidden files (those whose name starts with a .
) when using an ls
option like -A
that causes them to be shown. I would like all hidden files (but not directories) to be shown in some vivid red color in the Terminal (say magenta). Please, take note that I'm a noob with the Terminal commands (I only know some basic Unix commands), so I need something simple, no fancy tricks.
So how should I do this? What commands should I add into my .zshrc file above?
ls
to list them using-a
or-A
?.
) visible but colored? Those are two separate things. To always see hidden files, make a new alias, like the ones you show there, something likela='ls -A'
and then usela
instead ofls
. But please edit your question and clarify that you want two things: i) always show hidden files and ii) show them in a specific color.ls
doesn't show these files. So you want two things: you want to see them in the output ofls
(which is done by usingls -A
) and you want to set them to a specific color. Finder isn't relevant, we're only discussing the command line.