color Archives - David Yin's Blog https://www.yinfor.com/tag/color Tech geek. Life geek. Wed, 30 May 2018 00:33:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.yinfor.com/wp-content/uploads/2016/09/cropped-icon-120x120.png color Archives - David Yin's Blog https://www.yinfor.com/tag/color 32 32 Color Scheme for the command line of bash https://www.yinfor.com/2018/05/color-scheme-for-the-command-line-of-bash.html https://www.yinfor.com/2018/05/color-scheme-for-the-command-line-of-bash.html#respond Wed, 30 May 2018 00:33:29 +0000 https://www.yinfor.com/?p=5579 When I install the Ubuntu server and ssh to the server, the default shell is bash. It looks like below. I prefer to have a colorful terminal window. So I goole it and find the solution: open ~/.bashrc in an...

The post Color Scheme for the command line of bash appeared first on David Yin's Blog.

]]>
When I install the Ubuntu server and ssh to the server, the default shell is bash.

It looks like below.

I prefer to have a colorful terminal window. So I goole it and find the solution:

  • open ~/.bashrc in an editor
  • copy this and add it at the end of .bashrc file:
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '

  • save the file and restart bashrc:
source ~/.bashrc

After that, the terminal window changed as below:

The user name, host name, path have different colors.

 

There is option to use bash’s official color scheme.

Open ~/.bashrc in text editor and uncomment line:

#force_color_prompt=yes

Save then execute source ~/.bashrc

The terminal window will be changed to :

It has color promot, but it is not that easy to read.

The post Color Scheme for the command line of bash appeared first on David Yin's Blog.

]]>
https://www.yinfor.com/2018/05/color-scheme-for-the-command-line-of-bash.html/feed/ 0
Bashrc is not loading? (Fixed) https://www.yinfor.com/2017/05/bashrc-not-loading-fixed.html https://www.yinfor.com/2017/05/bashrc-not-loading-fixed.html#respond Mon, 29 May 2017 21:08:06 +0000 https://www.yinfor.com/?p=5107 I have the .bashrc file, but it is not loading when I connect my VPS through SSH. The content of .bashrc looks like below: It provides a colorful terminal look. How to fix the problem of .bashrc not loading? If...

The post Bashrc is not loading? (Fixed) appeared first on David Yin's Blog.

]]>
I have the .bashrc file, but it is not loading when I connect my VPS through SSH.

The content of .bashrc looks like below:

alias ls='ls --color=auto'
force_color_prompt=yes
PS1='\[\033[1;36m\]\u\[\033[1;31m\]@\[\033[1;32m\]\h:\[\033[1;35m\]\w\[\033[1;31m\]\$\[\033[0m\] '

It provides a colorful terminal look.

How to fix the problem of .bashrc not loading?

If you always want the content of your .bashrc file processed, you might add something like the following to your .bash_login file:

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

If you don’t have this file, just add a new one at your home directory.

Save the content and exit the terminal.

Re-connect the VPS. It works.

The post Bashrc is not loading? (Fixed) appeared first on David Yin's Blog.

]]>
https://www.yinfor.com/2017/05/bashrc-not-loading-fixed.html/feed/ 0