How to change the default --color preference for "ls' on Windows?



The question of how to change the default color preference for the ‘ls’ command on Windows is a common one for many IT administrators. The ‘ls’ command is used to list the content of a directory, and can be used to list files, directories, and other objects. By default, the ‘ls’ command uses a particular color scheme to distinguish files and directories, but this color scheme can be changed to suit the user’s preference.

In order to change the default color scheme for ‘ls’, the user must first open the Windows Command Prompt. Once the Command Prompt is open, the user should type in the following command:

\color [color code]\

Where [color code] is the color code that the user wishes to use. For example, if the user wanted to use the color blue, they would type in \color 04\. This will set the color of the ‘ls’ output to blue.

Once the desired color is chosen, the user can then save this setting as the default. To do this, the user should type in the following command:

\color /s\

This command will save the current color setting as the default, so that it will be used every time the ‘ls’ command is used.

It is also possible to change the colors for individual files and directories, instead of the entire ‘ls’ command. This can be done by using the ‘dir’ command instead, which can be used to list the contents of a directory, as well as to set individual colors for files and directories.

The syntax to use for this is as follows:

\dir [file or directory name] /A: [color code]\

Where [file or directory name] is the name of the file or directory that the user wishes to change the color of, and [color code] is the color code that they wish to use. For example, if the user wanted to set the color of the directory “My Documents” to blue, they would type in \dir My Documents /A: 04\.

By using these commands, IT administrators can easily change the default color scheme for ‘ls’, as well as for individual files and directories. This can be a useful feature for helping the user to easily distinguish between different types of files and directories, as well as for making the output of the ‘ls’ command more visually appealing.

Inquire Now

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Find your next full or part-time role here

ScaleDesk can either help you find your next full time gig or a part time side gig where you can create extra income!

Onboard with us once
Skip HR screening and go to the final interview with with only your resume and a video interview you never have to redo
Get paid electronically every month for the hours you work
We will be your reference even if you work for us once

IT Teams: Use ScaleDesk to augment your team

Schedule Demo