1

I have been working with different distributions of Linux.

I noticed sometimes when I'm using SSH to connect to another Linux server, sometimes it has color to indicate different folders when I'm using ls command. for example a folder with 777 permission will have green color on it. But sometimes with another Linux server, it only show white color texts.

I prefer to have color displayed. What should I do to enable color indication?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Zhenyu
  • 133
  • 1
  • 1
  • 6
  • 3
    Maybe the shell configurations on those servers don't have `ls` aliased to `ls --color=auto`? – Ryan Smith May 03 '17 at 14:07
  • 1
    Also check the output of `echo $TERM` on various machines, color and colorless as well. – schaiba May 03 '17 at 14:08
  • I found an answer her. I need to edit .bashrc https://askubuntu.com/questions/517677/how-to-get-a-colored-bash – Zhenyu May 03 '17 at 14:18
  • Possible duplicate of [Colorizing your terminal and shell environment?](https://unix.stackexchange.com/questions/148/colorizing-your-terminal-and-shell-environment) – G-Man Says 'Reinstate Monica' May 04 '17 at 00:59
  • Also related: [Nested `ssh` session inside `screen` has no color](https://unix.stackexchange.com/q/6325/80216),  [Tmux eclipsed colorized output of `ls`](https://unix.stackexchange.com/q/52144/80216),  and [Colored output?](https://unix.stackexchange.com/q/283983/80216) – G-Man Says 'Reinstate Monica' May 04 '17 at 01:05

1 Answers1

0

Make things colored is a part of ANSI/VT100 color codes. As long as your terminal supports that, you can have bunch of features besides colors. I deeply encourange you to have a better understading of that:

Everything else is application depending; for example: pure ls does not color directories and files, but with --color argument - yes.