System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

disable colour in linux terminal

disable colour in linux terminal

Dear guys we are using netterm terminal emulator software for working with linux terminal .when we listing directories ,files or editing using vi editor the screen is getting coloured how we can disable this colour feature of linux

regards
Baiju
nothing is impossible
5 REPLIES
Matti_Kurkela
Honored Contributor

Re: disable colour in linux terminal

The colouring happens because there is a shell alias or a shell function that adds the colouring options to the ls command by default.

----

To avoid the colouring in a single command:
use "/bin/ls" instead of just "ls", or use "ls --color=none".

----

To disable the colouring for the current session only, depending on which shell you're using and how it is configured, one of the following commands should work:
unalias ls
unset ls

The first command will remove a shell alias named "ls", the second will remove a shell function named "ls".

----

If you want to disable the colouring completely for the user(s) for all future sessions, examine the start-up scripts of the shell you're using.

For the Linux standard shell "bash", see /etc/profile, /etc/bashrc (or /etc/bash.bashrc as some distributions use a different name) and /etc/profile.d directory if it exists. Usually there is a function like this defined somewhere:

function ls()
{
/bin/ls -FN --color=auto "$@"
}

Comment this function out to remove the colouring permanently.

MK
MK
Wouter Jagers
Honored Contributor

Re: disable colour in linux terminal

Hiya,

For one command:
# ls --color=none

To just disable it alltogether, remove the alias for ls:
# unalias ls

Hope that helps,
Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Ivan Ferreira
Honored Contributor

Re: disable colour in linux terminal

Try also:

export TERM=linux-m
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jess Long
Frequent Advisor

Re: disable colour in linux terminal

If you want to disable color for all users and all sessions, edit the file /etc/DIR_COLORS and replace the line that reads, 'COLOR all' with 'COLOR none'.

If you want to disable color for a given user, then in that user's home directory, edit or create a file named '.dircolors' or '.dir_colors', and make sure there is a line that reads, 'COLOR none'.
Tobu
Occasional Advisor

Re: disable colour in linux terminal

"#alias ls=ls" is easiest option.