How to make Ubuntu server terminal have the same font and colour scheme as Ubuntu desktop's terminal?
I am trying to make the terminal in Ubuntu server look and feel like the Ubuntu desktop terminal in terms of font and colour scheme. Is there a way to do this?
When you log in to a tty this is a login shell, so it sources, ~/.profile
or if it exists, ~/.bash_login
or if it exists, ~/.bash_profile
(usually only ~/.profile
exists in Ubuntu).
~/.bashrc
is sourced by interactive non-login shells (terminals you open in a desktop environment)
Here are aliases present by default in Ubuntu (desktop) for colours in terminals:
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
These are found in .bashrc
If they are not present, you can add them there.
To get the same settings as .bashrc
in a login shell (tty) you should make sure that .bash_profile
or .bash_login
or .profile
is sourcing your .bashrc
by putting something like this in your .bash_profile
or .bash_login
or .profile
, if it is not already there:
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
The font is a different matter:
sudo apt install fonts-ubuntu-font-family-console
Then add this line to the end of the same file (.bash_profile
, .bash_login
or, most likely, .profile
)
setfont /usr/share/consolefonts/UbuntuMono-R-8x16.psf
To use it immediately, you can source .profile
(or whichever file you put it in), otherwise, it will be changed on your next log in.