What Do the Different Colors Mean in the Linux ls Command?

In this tutorial, we will attempt to explain what these colors represent and what exactly determines the specific color.

What Do the Different Colors Mean in the Linux ls Command?

In Linux and other Unix-Like operating system, the ls command allows you to list the files and directories in a specified directory.

The ls command is one of the most basic and yet fundamental commands in Linux. And whether you are just getting started with Linux terminal or have used it for years, the ls command will always be part of your arsenal.

However, have you ever wondered what the different colors mean in the ls command output?

What Determines the Color Output of the ls Command?

In Linux terminals, the colors displayed by the ls command are determined by the configuration of your terminal and the environment variable LS_COLORS.

To view the values of the LS_COLORS variable, you can use the echo command as shown:


The command above should return an output as shown:


NOTE: The actual values may vary depending on your terminal configuration. The above are the default values for an Ubuntu system.

What do the colors of the ls command mean?

As we have stated, the specific meanings of colors may vary slightly depending on your system and the terminal configuration. However, the following are the typical meaning colors of the output of the ls command.



Blue is typically used to represent directories. When you use the ls command, directories are often displayed in blue to differentiate them from regular files.

Light Green

Light Green is usually used to represent executable files. Executable files are those that can be run as programs or scripts.


Cyan is commonly used to represent links or symbolic links. Symbolic links are special files that act as pointers to other files or directories.


Red is often used to highlight compressed or archived files. When you see red filenames, it usually indicates that the file has been compressed using tools like gzip or bzip2.


Magenta is commonly used to indicate image files. It helps to identify files that are in commonly used image formats such as JPEG, PNG, or GIF.


Yellow is typically used to represent device files or special files related to the system. These files include devices like hard drives, printers, or other peripherals.

White or Default

Regular files are usually displayed in white or the default color of your terminal. These are non-executable, non-compressed files without any special color codes.


In this tutorial, we attempted to outline the basic colors used in the ls command and what each of them could mean in your terminal output.

Note: You can customize the color scheme based on your preferences or your system's configuration. You can also modify the LS_COLORS environment variable to change the colors associated with different file types, or you can use command-line options to disable or modify the colors displayed by the ls command.

Table of Contents
Great! Next, complete checkout for full access to GeekBits.
Welcome back! You've successfully signed in.
You've successfully subscribed to GeekBits.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.