Terminal Customization (Bash)
Info
This guide will walk you through customizing your Bash prompt, how to run fastfetch on start in your terminal, and a few useful terminal programs.
Caution
This tutorial assumes that you are using Bash as your shell, even though some part of the tutorial may apply to non-Bash shells.
For non-Bash users, we cannot guarantee success and will not take responsibility to damages to your system.
Back up current .bashrc
Make a copy of your current .bashrc file and place it somewhere safe.
cp ~/.bashrc ~/.bashrc-original # Makes a copy of current .bashrc file named .bashrc-originalMake sure that you have a .bashrc file in your /home/$USER/ at all times. If you followed the command above, you'd be fine.
You'll be editing the .bashrc file from your home directory in this guide, but if you ever want/need to revert back to the original file, simply replace the content in .bashrc from the backup you've made.
Here is an exemplar .bashrc file taken from my Fedora 42 Workstation (hopefully you don't have to use this):
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rcAesthetic Changes
Quick append & preview
Your .bashrc should look something like this if you decide to follow all instructions in the following section:
# ... omitted original .bashrc content above
fastfetch
PS1='------------------\n\[$(tput setaf 21)\][\[$(tput setaf 27)\]\u \[$(tput setaf 33)\]@ \[$(tput setaf 39)\]\h\[$(tput setaf 21)\]] \[$(tput setaf 45)\]\w\[$(tput sgr0)\]\n > '
Autorun fastfetch when you open the terminal
You can make your bash terminal autorun fastfetch to display system information every time it starts by appending the following at the bottom of your file.
Installation
Fedorasudo dnf install fastfetchArchpacman -S fastfetchDebian/Ubuntusudo apt install fastfetchSet up
fastfetchin shellYou can append the following at the bottom of your
.bashrc:.bashrcfastfetchand here is what it looks like:

Changing the look of the prompt (
PS1)Now, in your
.bashrc, you change the looks of your prompt looks through modifying thePS1variable.You can append the following at the bottom of your
.bashrc:.bashrcPS1='------------------\n\[$(tput setaf 56)\][$(tput setaf 56)\]\u \[$(tput setaf 92)\]@ \[$(tput setaf 128)\]\h\[$(tput setaf 128)\]] \[$(tput setaf 200)\]\w\[$(tput sgr0)\]\n > 'and here is what it looks like:
More resources
Terminal programs
Quick append & preview
Your .bashrc should look something like this if you decide to follow all instructions in the following section:
# ... omitted original .bashrc content above
#### fzf-related aliases ####
alias cmd='compgen -c | fzf' # search for a possible command
alias zh='history | fzf' # search in bash command history
#### enabling zoxide ####
eval "$(zoxide init bash)"
#### eza-related aliases ####
# list directories in a tree format (or specify how many levels to list them)
alias lsd='eza -TD'
alias lsd1='eza -TD --level 1'
alias lsd2='eza -TD --level 2'
alias lsd3='eza -TD --level 3'
# list items in tree format (or specify how many levels to list them)
alias lst='eza -T'
alias lst1='eza -T --level 1'
alias lst2='eza -T --level 2'
alias lst3='eza -T --level 3'
# list all directories in tree format including hidden ones (or specify how many levels to list them)
alias lsda='eza -TDa'
alias lsda1='eza -TDa --level 1'
alias lsda2='eza -TDa --level 2'
alias lsda3='eza -TDa --level 3'
# list all items in tree format including hidden ones (or specify how many levels to list them)
alias lsta='eza -Ta'
alias lsta1='eza -Ta --level 1'
alias lsta2='eza -Ta --level 2'
alias lsta3='eza -Ta --level 3'Using fzf (Fuzzy Find)
What is fzf?
fzf is a command-line fuzzy finder that helps you quickly search and navigate files, directories, command history, and more.
Installation
Fedorasudo dnf install fzfArchpacman -S fzfDebian/Ubuntusudo apt install fzfAdd aliases
Below are example aliases:
.bashrcalias cmd='compgen -c | fzf' # search for a possible command alias zh='history | fzf' # search in bash command historyMore resources
- Tutorial on how to use
fzfby DevOps Toolbox - Use
fzfwithzoxideby Dreams of Autonomy - More info about
fzffrom the officialfzfGitHub page.
- Tutorial on how to use
Using zoxide
What is zoxide?
zoxide is a terminal program that is like cd on steroids. It provides cd's functionality with the addition of being able to jump to directories with short, fuzzy-matched commands.
Installation
Fedorasudo dnf install zoxideArchsudo pacman -S zoxideDebian/Ubuntusudo apt install zoxideSet up
zoxidein your Bash shellAppend the following to your
.bashrc:.bashrceval "$(zoxide init bash)"More resources
Using eza
What is eza?
eza is a modern alternative to the classic ls, it provides color-coding, tree-styled outputs, git integration, and more.
Installation
FedoraAs of Fedora 42, there is no maintainer for
ezaso you'll be unable to downloadezathroughdnf.sudo dnf install ezaArchpacman -S ezaDebian/Ubuntusudo apt install ezaAdd aliases
Below are some example aliases:
.bashrc# list directories in a tree format (or specify how many levels to list them) alias lsd='eza -TD' alias lsd1='eza -TD --level 1' alias lsd2='eza -TD --level 2' alias lsd3='eza -TD --level 3' # list items in tree format (or specify how many levels to list them) alias lst='eza -T' alias lst1='eza -T --level 1' alias lst2='eza -T --level 2' alias lst3='eza -T --level 3' # list all directories in tree format including hidden ones (or specify how many levels to list them) alias lsda='eza -TDa' alias lsda1='eza -TDa --level 1' alias lsda2='eza -TDa --level 2' alias lsda3='eza -TDa --level 3' # list all items in tree format including hidden ones (or specify how many levels to list them) alias lsta='eza -Ta' alias lsta1='eza -Ta --level 1' alias lsta2='eza -Ta --level 2' alias lsta3='eza -Ta --level 3'More resources
- Quick overview on
ezaby Josean Martinez
- Quick overview on
Contributors
Changelog
35118-Grammar and Spell Checks for the entire Webon54c8f-Restructuring for better asset management.on9c34e-Adjust difficulty.on5810a-Cleaner way of displaying contributors in articles.on26c5a-Restructuring tags.on18d2a-Consistent heading stylingon6f292-Enhance markdown formatting for consistency across documentationonb8933-Using fewer tags for better tag sorting.on9537b-Update terminal customization and guides to include devicons for Linux distributionsone2f6b-Refactor guide authorship sections: update titles from "Maintainer" to "Author(s)" and "Contributors" to "Co-author(s)" across multiple guideson0e8c8-Update section titles for clarity in terminal customization guideone746c-Reorder Debian/Ubuntu to be after Fedora and Archondaeb8-Enhance documentation by adding missing line breaks, updating demo wrappers to include images, and refining contribution guidelines for clarity and consistency.onc31f9-Refactor terminal customization guide for improved clarity; update Bash example formatting and enhance details for Timeshift setup in Fedora guide.on686d1-Enhance formatting and clarity in Firefox user.js and Terminal customization guideson357ef-Consistency fixon0e14f-Added contributors to blogsond8be1-Making page more legible.on7d0cb-Adding collapseson6cd30-Terminal Customization Guide legibility improvementon62c4b-Automating steps.on731c5-Microtweakson0ed49-Mass renamingon99d1e-Fixed typoon41f78-deleting legacy metadataon25920-Restructuringon64610-Notes and sidebar work nowond95ee-Notes & sidebard don't work for some reason...ona154c-testing sidebar generationonddcec-Batch metadata editingon63f60-Draft ongoingonfb788-under-construction addedonac353-v1on85907-Better lookson718fb-Aesthetic changeson