Author(s)
aier
Author(s)
aier
Co-author(s)
Lunear
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.
.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-original
Make 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.
.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 rc
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 > '
fastfetch
when you open the terminalYou 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
sudo dnf install fastfetch
pacman -S fastfetch
sudo apt install fastfetch
Set up fastfetch
in shell
You can append the following at the bottom of your .bashrc
:
fastfetch
and 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 the PS1
variable.
You can append the following at the bottom of your .bashrc
:
PS1='------------------\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
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'
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
sudo dnf install fzf
pacman -S fzf
sudo apt install fzf
Add aliases
Below are example aliases:
alias cmd='compgen -c | fzf' # search for a possible command
alias zh='history | fzf' # search in bash command history
More resources
fzf
by DevOps Toolboxfzf
with zoxide
by Dreams of Autonomyfzf
from the official fzf
GitHub page.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
sudo dnf install zoxide
sudo pacman -S zoxide
sudo apt install zoxide
Set up zoxide
in your Bash shell
Append the following to your .bashrc
:
eval "$(zoxide init bash)"
More resources
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
As of Fedora 42, there is no maintainer for eza
so you'll be unable to download eza
through dnf
.
sudo dnf install eza
pacman -S eza
sudo apt install eza
Add aliases
Below are some example 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'
More resources
eza
by Josean Martinez9537b
-Update terminal customization and guides to include devicons for Linux distributionson e2f6b
-Refactor guide authorship sections: update titles from "Maintainer" to "Author(s)" and "Contributors" to "Co-author(s)" across multiple guideson 0e8c8
-Update section titles for clarity in terminal customization guideon e746c
-Reorder Debian/Ubuntu to be after Fedora and Archon daeb8
-Enhance documentation by adding missing line breaks, updating demo wrappers to include images, and refining contribution guidelines for clarity and consistency.on c31f9
-Refactor terminal customization guide for improved clarity; update Bash example formatting and enhance details for Timeshift setup in Fedora guide.on 686d1
-Enhance formatting and clarity in Firefox user.js and Terminal customization guideson 357ef
-Consistency fixon 0e14f
-Added contributors to blogson d8be1
-Making page more legible.on 7d0cb
-Adding collapseson 6cd30
-Terminal Customization Guide legibility improvementon 62c4b
-Automating steps.on 731c5
-Microtweakson 0ed49
-Mass renamingon 99d1e
-Fixed typoon 41f78
-deleting legacy metadataon 25920
-Restructuringon 64610
-Notes and sidebar work nowon d95ee
-Notes & sidebard don't work for some reason...on a154c
-testing sidebar generationon ddcec
-Batch metadata editingon 63f60
-Draft ongoingon fb788
-under-construction addedon ac353
-v1on 85907
-Better lookson 718fb
-Aesthetic changeson