How Do I Change The Color For Directories With Ls Mac
Jun 20, 2017 Color your folders Click the small green '.' Icon and choose a folder to colour, then click 'OK'. Pick a colour and click 'Apply', then open Windows Explorer to see the change.
You can enable colorized output by passing the -G option to ls command on Apple Mac OS X or FreeBSD operating system. You don’t have to install anything special. Just pass the -G option to the ls command.Mac OS X color ls output option
Open the terminal application and simply type the following command:$ ls -G
Sample outputs:
Configure ~/.bashrc to display colorful ls command
You need to add the following command in the ~/.bashrc file:$ vi ~/.bashrc
Append the following alias:
Spotify installer zip file for mac windows 10. Save and close the file. Source the changes immediately:$ source ~/.bashrc
Test it:$ ls
$ ll
How do I skip colorful ls command output temporarily?
Download psychomorph for mac. Simply run the ls command as follows:$ ls
$ ls -l
The -G option is equivalent to defining CLICOLOR in the environment. The ls command supports the following environment variables:
- CLICOLOR – Use ANSI color sequences to distinguish file types.
- LSCOLORS – The value of this variable describes what color to use for which attribute when colors are enabled with CLICOLOR
Just type the following command to enable colorized output for the ls command:
Understanding LSCOLORS values
You can define color for each attribute with the help of LSCOLORS, when colors are enabled with CLICOLOR. This string is a concatenation of pairs of the format fb, where f is the foreground color and b is the background color. The default value is:
Where,
ls Attribute | Foreground color | Background color |
---|---|---|
directory | e | x |
symbolic | f | x |
socket | c | x |
pipe | d | x |
executable | b | x |
block | e | g |
character | e | d |
executable | a | b |
executable | a | g |
directory | a | c |
directory | a | d |
The color and their code values are as follows:
Code | Meaning (Color) |
---|---|
a | Black |
b | Red |
c | Green |
d | Brown |
e | Blue |
f | Magenta |
g | Cyan |
h | Light grey |
A | Bold black, usually shows up as dark grey |
B | Bold red |
C | Bold green |
D | Bold brown, usually shows up as yellow |
E | Bold blue |
F | Bold magenta |
G | Bold cyan |
H | Bold light grey; looks like bright white |
x | Default foreground or background |
You can now customize it as per your need in ~/.bashrc:
This entry is 1 of 5 in the Coloring Outputs in the CLI Apps Tutorial series. Keep reading the rest of the series:- How to enable colorized output for ls command in MacOS X Terminal
ADVERTISEMENTS