To turn off color in a Linux terminal or bash session, you can use the alias
command to create a new alias for the ls
command that disables color output.
Here's how to do it:
alias ls='ls --color=none'
This will create an alias called ls
that runs the ls
command with the --color=none
option, which disables color output.
.bashrc
file. To do this, open the .bashrc
file in a text editor:nano ~/.bashrc
Scroll to the bottom of the file and add the following line:
alias ls='ls --color=none'
Save the file and exit the text editor. The next time you open a terminal or bash session, the alias will be available.
If you want to turn color back on, you can simply remove the alias by running the following command:
unalias ls
This will remove the ls
alias and restore the default behavior of the ls
command.