How to color-code your terminal output from “ls” for files and directories

Tremaine Eto
Dev Genius
Published in
3 min readSep 17, 2021

--

Photo by Dmitry Chernyshov on Unsplash

If you’re a regular user of the command line, like Terminal in MacOS, then you have most certainly used the ls command which allows you to see a list of the files and folders in a given directory.

To reinforce that, IBM documentation describes ls as the following:

The ls command writes to standard output the…

--

--

Senior Software Engineer @ Iterable | Previously worked at DIRECTV, AT&T, and Tinder | UCLA Computer Science alumni | Follow me for software engineering tips!