# Disable/Enable colors on Linux

**URL:** <https://community.unix.com/t/disable-enable-colors-on-linux/397034>\
**Category:** UNIX for Beginners Q & A\
**Created:** [June 6, 2025, 11:44am UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034 "2025-06-06T11:44:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_01](https://community.unix.com/letter_avatar/newbie_01/32/5_5575768a8748004e209b776fc1b2916d.png) [@newbie\_01](https://community.unix.com/u/newbie_01)\
**Post date:** [June 6, 2025, 11:44am UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/1 "2025-06-06T11:44:09Z")

</div>

Hi,

Can someone please tell me how to turn off/on all colors on Linux?  
SO far, I've unset LS\_COLORS and set TERM to xterm-mono or vt100.  
vi appears to be plain, no colors, so that's good.  
ls etc still appears in colors. I guess I have unalias all the alias that uses --color=auto? I thought unsetting LS\_COLORS will take care of.  
I just want a 'simple' sort of script that I can run to turn off/on colors.  
Please advise. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![vgersh99](https://community.unix.com/user_avatar/community.unix.com/vgersh99/32/14851_2.png) [@vgersh99](https://community.unix.com/u/vgersh99)\
**Post date:** [June 6, 2025, 1:12pm UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/2 "2025-06-06T13:12:05Z")

</div>

To forgo using aliased commands, prepend the command with **\**  
E.g.: `\ls`

---

<div class="post-metadata">

**Author:** ![Paul\_Pedant](https://community.unix.com/letter_avatar/paul_pedant/32/5_5575768a8748004e209b776fc1b2916d.png) [@Paul\_Pedant](https://community.unix.com/u/Paul_Pedant)\
**Post date:** [June 7, 2025, 12:00am UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/3 "2025-06-07T00:00:31Z")

</div>

Fight aliases with aliases.

```plaintext
#.. Define monochrome ls as lsm

alias lsm='ls --color=never'

paul: ~/spoom $ type -a ls
ls is aliased to `ls --color=auto'
ls is /usr/bin/ls
ls is /bin/ls
paul: ~/spoom $ type -a lsm
lsm is aliased to `ls --color=never'
paul: ~/spoom $ 

```

---

<div class="post-metadata">

**Author:** ![MadeInGermany](https://community.unix.com/letter_avatar/madeingermany/32/5_5575768a8748004e209b776fc1b2916d.png) [@MadeInGermany](https://community.unix.com/u/MadeInGermany)\
**Post date:** [June 7, 2025, 5:15am UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/4 "2025-06-07T05:15:18Z")

</div>

Because an alias may call an alias, consider

```plaintext
alias lsm='\ls --color=never'

```

---

<div class="post-metadata">

**Author:** ![Paul\_Pedant](https://community.unix.com/letter_avatar/paul_pedant/32/5_5575768a8748004e209b776fc1b2916d.png) [@Paul\_Pedant](https://community.unix.com/u/Paul_Pedant)\
**Post date:** [June 7, 2025, 8:29am UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/5 "2025-06-07T08:29:40Z")

</div>

My bad: should be `--color=never`. I fixed it in my test as shown, but failed to alter the text that was already in my post.

There is an oddity in your note about alias=\>alias. I chose to allow this (i.e. not quote the aliased `ls`) so that any other args in an existing alias would work. Clearly, my default `ls` has `--color=auto`, and the normal convention is that last arg wins. But in this case, `ls` obeys the first color option (presumably to fix just this case).

Aliases can be lethal. I had a client (actually their senior developer) who was trying to force a rebuild on a remote machine, but kept deleting sources, libraries, and include files unintentionally. He was running a remote `ls`, checking the list, and then sending that back with a `rm` on the front.

Trouble was, the remote server had an alias `ls -F`, as part of the vendor's install. The indicator is `*` for executables, and that then became a wildcard on the `rm` command.

---

<div class="post-metadata">

**Author:** ![MadeInGermany](https://community.unix.com/letter_avatar/madeingermany/32/5_5575768a8748004e209b776fc1b2916d.png) [@MadeInGermany](https://community.unix.com/u/MadeInGermany)\
**Post date:** [June 7, 2025, 12:00pm UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/6 "2025-06-07T12:00:27Z")

</div>

Haha, I blindly copied yours, assuming the `=`  
Now corrected.

Yes, you should not trust the `ls` output, for many reasons.  
And be extra careful with `rm`. E.g. first replace it with `echo` or better `printf "%s\n"`.

---

<div class="post-metadata">

**Author:** ![system](https://community.unix.com/uploads/default/original/2X/c/c7e9e16a595259edafe88615719d5c5dcda035c2.png) [@system](https://community.unix.com/u/system)\
**Post date:** [December 4, 2025, 12:01pm UTC](https://community.unix.com/t/disable-enable-colors-on-linux/397034/7 "2025-12-04T12:01:08Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
