Skip to main content Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed | Gopher

Some Bash and Arch Tweaks

Published: 01-01-2012 | Author: Remy van Elst | Text only version of this article

❗ This post is over ten years old. It may no longer be up to date. Opinions may have changed.

Table of Contents

So, I have some nice tips for your .bashrc, with screenshots. Also a handy command to show your biggest packages in pacman/arch.

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days.

Simple Calendar with today marked as


alias tcal='cal | sed "s/^/ /;s/$/ /;s/ $(date +%e) / $(date +%e | sed '''s/./#/g''') /"' 
Fast cd up:
alias ..='cd ..'
alias ...='cd ../..' 
Network Info (LAN IP, IP and MAC):


netinfo ()
echo "Internal IPv4 address of eth0: "; ifconfig | grep 'inet addr:'| grep -v '' | cut -d: -f2 | awk '{ print $1}'
echo "External IPv4 address: "; wget -q -O -|sed -e 's/.*Current IP Address: //' -e 's/
Biggest folders in directory Gigabyte version:


alias dug='du -h | grep ^[0-9.]*G | sort -rn | head -n 20'
Biggest folders in directory Megabyte version:


alias dum='du -h | grep ^[0-9.]*M | sort -rn | head -n 20'
Process Grep:


alias pg='ps -ef | grep '
Nice greeting when opening a bash shell:


PS1="u@h  -  tn${PWD}/ -$ "
echo "Welkom Remy,"
echo "Het is vandaag:";
echo "Deze PC draait op een:" 
/bin/uname -p
echo ""

(put this one at the end of your .bashrc file)

And the huge packages finder:


pacman -Qi | awk '/Name/ { name=$3 } /Size/ { printf "%.3fMBt%sn", $4/1024, name }' | sort -rh | head -n $1
exit 0

(I've put this in /usr/bin/dup and chmodded it to 755).

Thanks to the arch forum for most of these tips!

Tags: alias , arch , bash , snippets , tweaks