I actually use a linked file to hold all my aliasâs, mostly because not all apply to Arch because I distro-hop so often.
~/.bash/.alias
Clear screen
alias cls=âclearâ
alias more=âlessâ
alias â:qâ=âexitâ
Invoke irssi session within tmux
alias irs=âtmux new -s irssi irssiâ
Sudo
alias sudo='sudo â
alias kdsu='kdesu dbus-launch â
alias reboot=ârebootâ
alias poweroff=âpoweroffâ
alias halt=âhaltâ
Clean python crud
alias pyclean=âfind . -name *.pyc -o -name *.pyo -o -name pycache -deleteâ
Pacman
alias pacman=âsudo pacman --color autoâ
alias pacupd=âpacman -Syyâ
alias pacupg=âpacman -Syyuâ
alias pacins='pacman -S â
alias pacnoc='pacman -S --noconfirm â
alias pacrem='pacman -R â
alias pacdep='pacman -Rcn â
alias pacshq=âpacman -Ql pacman | awk -Fâ[/ ]" â//usr/bin/ {print $5}â"
alias pksyua=âyay -Syyu --noconfirmâ
alias editpac=âsudo /opt/sublime_text/sublime_text /etc/pacman.confâ
â[r]emove [o]rphansâ - recursively remove ALL orphaned packages
alias pacrmo="/usr/bin/pacman -Qtdq > /dev/null && sudo /usr/bin/pacman -Rns $(/usr/bin/pacman -Qtdq | sed -e â:a;N;$!ba;s/\n/ /gâ)"
Yay
alias yayupd=âyay -Syyâ
alias yayupg=âyay -Syuâ
alias yayrem='yay -R â
alias yayrms='yay -Rs â
alias yayins='yay -S â
alias yaynoc='yay -S --noconfirm â
Zypper
alias zypdup=âsudo zypper dup --allow-vendor-changeâ
reflector update mirrors
alias reflect=âreflector --latest 20 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlistâ
alias reflectus=âreflector --country âUnited Statesâ --latest 20 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlistâ
alias ps=âps auxfâ
alias psgrep=âps aux | grep -v grep | grep -i -e VSZ -eâ
#print username uid(1000)
alias uid1000=âawk -v val=1000 -F â:â â$3==val{print $1}â /etc/passwdâ
#grub update
alias grubupd=âsudo grub-mkconfig -o /boot/grub/grub.cfgâ
#improve png
alias fixpng=âfind . -type f -name â*.pngâ -exec convert {} -strip {} ;â
#mounting the folder Public for exchange between host and guest on virtualbox
alias vbm=âsudo mount -t vboxsf -o rw,uid=1000,gid=1000 Public /home/$USER/Publicâ
Reaload bashrc
alias rl=âcls && . ~/.bashrcâ
cli infos
alias nf=âcls && neofetch --ascii_distro archâ
alias al=âcls && alsi -lâ
alias alsi=âcls && alsiâ
Reinitialise Resources
alias xr=âxrdb -merge ~/.Xresourcesâ
alias xl=âxrdb -load ~/.Xresources && rlâ
Local / Public IP
alias mypip=âcurl ipecho.net/plain; echoâ
alias mylip=âifconfig | sed -En âs/127.0.0.1//;s/.inet (addr:)?(([0-9].){3}[0-9])./\2/pââ
The âlsâ family
alias ll=âls -l --group-directories-firstâ
alias ls=âls -h --colorâ # add colors for filetype recognition
alias la=âls -a --colorâ # show hidden files
alias lx=âls -xbâ # sort by extension
alias lk=âls -lSrâ # sort by size, biggest last
alias lc=âls -ltcrâ # sort by and show change time, most recent last
alias lu=âls -lturâ # sort by and show access time, most recent last
alias lt=âls -ltrâ # sort by date, most recent last
alias lm=âls -al |moreâ # pipe through âmoreâ
alias lr=âls -lRâ # recursive ls
alias lsr=âtree -Csuâ # nice alternative to ârecursive lsâ
Call Sublime Text
alias sub="/opt/sublime_text/sublime_text "
alias subrc="/opt/sublime_text/sublime_text ~/.bashrc"
alias subal="/opt/sublime_text/sublime_text ~/.bash/.alias"
alias subbp="/opt/sublime_text/sublime_text ~/.bash_profile"
alias subxr="/opt/sublime_text/sublime_text ~/.Xresources"
Shortcuts to edit startup files
alias vim="vim "
alias vi="vim "
alias vali=âvim ~/.bash/.aliasâ
alias vbrc=âvim ~/.bashrcâ
alias vbpf=âvim ~/.bash_profileâ
Misc utilities
alias du=âdu -khâ
alias df=âdf -kThâ
alias chx=âchmod +xâ
launch ncmpcpp
alias ncmp=âncmpcpp 2> /dev/nullâ
View the entire VIM User Guide
Change âvim80â for currently installed version
if [ -x /bin/cat -a -x /usr/bin/vim ]; then
alias vug=â/bin/cat /usr/share/vim/vim80/doc/usr_*.txt | /usr/bin/vim -â
fi
Efficient and fairly portable way to display the current iface.
[ -x /sbin/ip ] && alias iface=âX=(/sbin/ip route
) && echo ${X[4]}â
Fix all CWD file and directory permissions to match the safer 0077 umask.
if [ -x /bin/chmod ]; then
alias fixperms=â
/usr/bin/find -xdev ( -type f -exec /bin/chmod 600 â{}â + -o
-type d -exec /bin/chmod 700 â{}â + )
-printf âFIXING: %p\nâ 2> /dev/null
â
fi
Display a columnized list of bash builtins.
if [ -x /usr/bin/column ]; then
alias builtins=â
while read -r; do
echo â${REPLY/* }â
done <<< â$(enable -a)â | /usr/bin/column
â
fi
A more descriptive, yet concise lsblk; youâll miss it when itâs gone.
if [ -x /bin/lsblk ]; then
alias lsblkid=â
/bin/lsblk -o name,label,fstype,size,uuid,mountpoint --noheadings
â
fi
Ease-of-use youtube-dl aliases; these save typing!
for DEP in /usr/{local/bin,bin}/youtube-dl; {
[ -x â$DEPâ ] && {
alias ytdlv="$DEP -c --yes-playlist --sleep-interval 5
âformat best --no-call-home --console-title
âignore-errors"
alias ytdla="$DEP -cx --audio-format mp3 --sleep-interval 5\
--max-sleep-interval 30 --no-call-home --console-title\
--quiet --ignore-errors"
alias ytpla="$DEP -cix --audio-format mp3 --sleep-interval 5\
--yes-playlist --no-call-home --console-title\
--ignore-errors"
alias ytplv="$DEP -ci --yes-playlist --sleep-interval 5\
--format best --no-call-home --console-title\
--ignore-errors"
# Just use the first result.
break
}
}
unset DEP