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
.profile is sourcing your
.bashrc by putting something like this in your
.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_login or, most likely,
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.
All style and color stuff is related to your shell configuration. In the case of bash (Ubuntu standard) it is a simple file called .bashrc in your home folder. Copy it to the according folder (home folder of the user you are on the server) on the server and after reloading the shell it should be the same provided you do not need to install any further packages. Other shells are similar to bash, zsh e.g. uses a .zshrc. In some cases you also have to copy more files if you did more advanced tweaks on your shells (e.g. .bash_aliases).