Sal
akash "Akash Blog". min read

In Linux how to colored terminal over ssh

When I connect over ssh to remote hosts, everything is just a single font/color. you can set colorful terminal

  1. Open ~/.bashrc in a text editor.
  2. Copy this and add it at the end of the ~/.bashrc file:

    PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '
  3. Save the file and source ~/.bashrc:
    eg: source ~/.bashrc
  4. set bashrc in your ssh session by adding the following to ~/.bash_profile

if [ -f ~/.bashrc ]; then . ~/.bashrc fi

Or uncommented the line force_color_prompt=yes in the file ~/.bashrc

  Never miss a story from us, get weekly updates in your inbox.