Turn off color in Linux terminal/bash session

I am a new GNU/Linux user. I see a colorful bash prompt. Traditional command such as grep command or ls command also display output in colors. I would also like a turn off colors in vim text editor. I do not like colors. How can I turn off color listing in Linux terminal?

You can disable all color in your shell. By default, colors are turned on by many commands. The xterm program is a terminal emulator for the X Window System. It enables colors too. Setting up TERM shell variable to VT220 or xterm-mono will also help. Let us see how to turn off colors in Linux terminal session.

How to setup TERM shell variable

The environment variable TERM contains a identifier for the text window’s capabilities. You can get a detailed list of these cababilities by using the infocmp command, using ‘man 5 terminfo’ as a reference. To see current value run the following echo command:
echo "$TERM"
Sample outputs:


So my xterm set with 256 colors. To make it mono set it too xterm-mono:
export TERM=xterm-mono
Better update your ~/.bashrc file with above line:
echo 'export TERM=xterm-mono' >> ~/.bashrc

Turn off color in Linux terminal for ls/grep/egrep commands

By default, ls command/grep command/nixcmd name=”egrep”] are aliased as follows:
type -a ls
alias ls='ls --color=auto'

You can verify it with the command command or type command as follows:
command -V grep
type -a grep
command -V egrep

To disable this, find and delete or comment out above lines in your ~/.bashrc or ~/.bash_aliases #alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'

Save and close the file. Use source command to update your settings:
source ~/.bashrc
source ~/.bash_aliases

See “How to create a permanent Bash alias on Linux/Unix” for more info.

How to disable vim text editor color syntax highlighting

Syntax highlighting is nothing but a feature of vi/vim text editors that displays text, especially source code, in different colors and fonts according to the category of terms. To turn it off, press ESC key, type the following when editing a file:
:syntax off
Update your ~/.vimrc file and delete line that read as follows:
syntax off
See “Turn On or Off Color Syntax Highlighting In vi or vim Editor for more info.

How to disable colorful bash prompt

Again edit your ~/.bashrc file:
vi ~/.bashrc
joe ~/.bashrc
Find and line that read as follows:
Comment it out:
Save and close the file. You must close and reopen your terminal app. Here is my terminal after disabling all colors:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • TC Nov 29, 2020 @ 19:33

    I do not have a .bashrc or a .bash_aliases. I am on a VM linux host on GoDaddy. It would be helpful if you gave the command line command to turn off the coloring.

  • b0b Jan 6, 2021 @ 11:28

    When disabling color with ls, it might be useful to use the -F option to append a symbol at the end of filenames to quickly indicate their type (folder, executable, link, ..).

  • Stephan Brun Jan 22, 2021 @ 11:24

    I like my terminals white, the way xterm and Sun consoles used to be, and I’ve found vim no longer follows the base colour of the terminal, but instead insists on black. How do I force it to conform to my terminal customisation? I’m on Calculate, a Gentoo derivative.

  • Stephan Brun Jan 22, 2021 @ 12:34

    Seems the vim problem is actually a long-standing issue with vim changing background colour based not on configured colours but on the default for the terminal program (xfce4-terminal in my case.) Apparently no one has fixed the bug.
    Changing colorscheme to peachpuff is a temporary fix though.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum