Skip to content

Garuda Fish CheatSheet

Here are some common Garuda aliases that will make your fish shell experience a little smoother. The defaults live in /usr/share/garuda/garuda-fish-config/config.fish. Your own ~/.config/fish/config.fish sources them, so add your changes there.

These replace ls with eza and cat with bat.

CommandAlias/ShortcutPurpose
eza -al --group-directories-firstlsLong listing with hidden files, folders first
eza -al --total-size --group-directories-firstlszSame as ls, with folder sizes
eza -a --group-directories-firstlaAll files and directories
eza -l --group-directories-firstllLong format
eza -aT --group-directories-firstltTree listing
eza -ald --group-directories-first .*l.Show only dotfiles
bat --style header,snip,changescatShow files with syntax highlighting and git change markers
paruyayOnly set when yay is missing and paru is installed
CommandAlias/ShortcutPurpose
man pacmanaptNow you can learn about pacman
man pacmanapt-getNow you can learn about pacman
sudopleasePlease give me root
nc termbin.com 9999tbA command line pastebin for you
echo "To print basic information about a command use tldr <command>"helpmeTldr will teach you to use a command
sudo -H DIFFPROG=meld pacdiffpacdiffcompare .pacnew and .pacsave files with the installed config files (pacman-contrib)
journalctl -p 3 -xbjctlView logs of the current boot, priority error and above
expac --timefmt="%Y-%m-%d %T" "%l\t%n %v" | sort | tail -200 | nlripShow the 200 most recently installed packages

Instead of typing the whole cd /path command to move back a directory, you can just substitute with . the number of times you would love to go back.

CommandAlias/Shortcut
cd ....
cd ../.....
cd ../../......
cd ../../../.......
cd ../../../../........

This includes system commands, or common commands but modified in a way to make life much easier for a garuda user.

CommandAlias/ShortcutPurpose
expac -H M "%m\t%n" | sort -h | nlbigSort installed packages according to size
sudo rm /var/lib/pacman/db.lckfixpacmanRemove lock from database to enable install
dir --color=autodirList directories in color
pacman -Q | grep -i "\-git" | wc -lgitpkgCount the installed -git packages
ugrep --color=autogrepAppealing visuals of grep
ugrep -E --color=autoegrepAppealing visuals of egrep
ugrep -F --color=autofgrepAppealing visuals of ugrep
sudo update-grubgrubupRegenerate the GRUB config
hwinfo --shorthwShow hardware info
ip -coloripShow your ip but in color
ps auxf | sort -nr -k 4psmemShow processes sorted by memory usage
ps auxf | sort -nr -k 4 | head -10psmem10Top 10 processes by memory usage
sudo pacman -RddrmpkgRemove a package without checking dependencies
tar -acftarnowCreate compressed archive file
tar -zxvfuntarUnzip tar archive
garuda-updateupdUpdate garuda linux
vdir --color=autovdirList directories in color, long format
wget -cwgetContinue downloading even when forgetting -c
CommandAlias/ShortcutPurpose
sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlistmirrorUpdate your mirror list by choosing fastest recent mirror
sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlistmirroraUpdate by selecting 20 most recent mirrors
sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlistmirrordUpdate your mirror based on delay
sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlistmirrors20 best mirrors based on their score
CommandPurpose
historyShow the fish history with date and time
backup FILECopy FILE to FILE.bak
copy SRC DESTCopy a folder recursively when SRC is a folder, otherwise a normal cp
cleanupRemove orphaned packages with sudo pacman -R until none are left
gitgTypo fix, runs git gui
KeysPurpose
!!Replace it with the previous command
! then $Recall the last argument of an earlier command (from the bang-bang plugin)
  • fastfetch on every new terminal: the config.fish in your home folder calls __garuda_fastfetch. It runs mokka.jsonc, then dr460nized.jsonc, then neofetch.jsonc, depending on what is installed. Comment out that last line to turn it off.
  • done: the upstream done plugin is shipped. It sends a notification when a long command finishes.
  • garuda-update hook: typing sudo pacman -Syu asks if you want garuda-update instead. y runs it, N continues with pacman, and i stops the question for good.

cleanup removes orphans in a loop until none are left, so it already handles orphans that only appear after the first removal. Before you run it, check what still refers to each orphan. The functions below read the pacman -Qi fields for every orphan from pacman -Qdtq.

Terminal window
function __orphan_field --argument orphan field
pacman -Qi $orphan | awk -v f="$field" '
$0 ~ "^" f " *:" { on = 1; sub(/^[^:]*: */, "") }
/^[A-Za-z][A-Za-z ]* *:/ && $0 !~ "^" f " *:" { on = 0 }
on { gsub(/^ +/, ""); printf "%s ", $0 }'
end
function check-orphan-dependents --description 'Show what requires or optionally uses each orphan'
set -l orphans (pacman -Qdtq)
if test -z "$orphans"
echo "No orphan packages found."
return
end
for orphan in $orphans
echo "$orphan"
echo " Required by: "(__orphan_field $orphan 'Required By')
echo " Optional for: "(__orphan_field $orphan 'Optional For')
end
end

Save both in ~/.config/fish/functions/ or paste them into the shell to test them. Run it with:

Terminal window
check-orphan-dependents

Source: Fish function to list all orphans and which installed packages list them as dependencies.