How to turn on or off colors in bash

by Vivek Gite on November 4, 2006 · 1 comment

Q. How do I turn on or off file name colors in bash shell?

A. Most modern Linux distro comes with alias that defines colors for your file. However ls command is responsible for displaying color on screen for files, directories and other object.

By default, color is not used to distinguish types of files. You need to pass --color option to ls command.

Task: Turn off colors

Type the following command
$ ls --color=none
Or just remove alias with unalias command:
$ unalias ls

Task: Turn on colors

Use any of the following command:
$ ls --color=auto
$ ls --color=tty

You can add or remove ls alias from ~/.bash_profile or ~/.bashrc file.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 Philippe Petrinko April 2, 2010

Well may be the title would be better if it would mention [ ls ].
something like:
How to turn on or off colors _for ls command_ in bash

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 9 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: