alias search='apt search'
alias file='apt-file search'
alias policy='apt policy'
alias show="nala show"
if user is not root, pass all commands via sudo
if [ $UID -ne 0 ]; then
alias update='sudo apt update'
alias ainstall='sudo apt install'
alias apurge='sudo apt purge -y --autoremove'
alias upgrade='sudo nala upgrade'
alias aremove='sudo apt autoremove -y'
alias clean='sudo nala clean'
alias reboot='sudo reboot'
alias shutdown="sudo shutdown -P now"
fi
Handy-dandy aliases for journalctl and systemctl
alias jc='sudo journalctl -b'
alias jca='sudo journalctl'
alias jcf='sudo journalctl -f'
alias jcr='sudo journalctl --list-boots'
alias sc='sudo systemctl'
Making files immortal & executable
alias im+="sudo chattr +i"
alias im-="sudo chattr -i"
alias exe="sudo chmod +x"
#Add safety nets
do not delete / or prompt if deleting more than 3 files at a time
alias rm='rm -I --preserve-root'
confirmation
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
Parenting changing perms on /
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
copy the current working directory to the clipboard
alias cpwd='pwd | xclip -selection clipboard'
Clipboard
alias cpy="xclip -selection clipboard"
quick directory movement
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
go to the last directory you were in
alias back='cd $OLDPWD'
quickly find files and directory
alias ff='find . -type f -name'
alias fd='find . -type d -name'
Create Python virtual environment
alias ve='python3 -m venv ./venv'
alias va='source ./venv/bin/activate'
Ping Commands
Stop after sending count ECHO_REQUEST packets
alias ping='ping -c 5'
alias pg="ping google.com -c 5"
alias shortcuts
alias rpi="sudo rpi-update"
alias rpi-next="sudo BRANCH=next rpi-update"
alias raspi="sudo raspi-config"
alias clr="clear"
alias clrh="history -c -w ~/.bash_history"
alias df='df -H'
alias du='du -ch'
alias mk="mkdir -p"
alias loading="sudo dmesg > ~/dmesg.txt"
ls Commands
Colorize the ls output and human readable sizes
alias ls='ls --color=auto --human-readable -al'
Use a long listing format
alias ll='ls -la'
Show hidden files
alias l.='ls -d .* --color=auto'
Listing files in folder
alias listkb="ls -l --block-size=K"
alias listmb="ls -l --block-size=M"
Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
Colorize diff output
alias diff='colordiff'
Start calculator with math support
alias bc="bc -l"
Resume wget by default
alias wget="wget -c"
ps Commands
alias ps="ps auxf"
Get top process eating cpu
alias pscpu="ps auxf | sort -nr -k 3"
alias pscpu10="ps auxf | sort -nr -k 3 | head -10"
Get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
The struggle I sometimes face when I SSH into somewhere, lol! Fortunately, there's a lot of differences that it's easy realize that "this is a different machine", and I just open a different terminal tab/window to look up the pure command versions if I need to.