# Show Disk Use of subdirectories, sort by size
alias duss="sudo du -d 1 -h | sort -hr | egrep -v ^0"
# Cheatsheet autogenerated from i3 configuration file
alias i3cheatsheet="egrep ^bind ~/.i3/config | cut -d ' ' -f 2- | sed 's/ /\t/' | column -ts $'\t' | pr -2 -w 145 -t | less"
# Show mount information in a nice format
alias mountt="mount | column -t | sort"
# Show remaining dirty bytes while coping to a file, very useful in XFCE not sure in other enviroments
alias watchdirty="watch grep -e Dirty: -e Writeback: /proc/meminfo"
# Bookmark directories ej. "bm a" "go a" etc
go() { eval dir=\$$1; cd "$dir"; }
bm() { eval $1=$(pwd); echo "`set | egrep ^[a-z]+=\/`" > ~/.bookmarks; }
test -f ~/.bookmarks && source ~/.bookmarks
# I use this one all the time, combined find+grep, f.e. fgr "Class" "*.cpp" "-l" (2nd and 3rd parameters optional"
function fgr {
NAM=""
GREPTYPE="-i -H"
if [ -n "$1" ]; then
test -n "$2" && NAM="-name \"$2\""
test -n "$3" && GREPTYPE=$3
CMMD="find . $NAM -not -path '*/\.*' -exec egrep --colour=auto $GREPTYPE \"$1\" {} + 2>/dev/null"
>&2 echo -e "Running: $CMMD\n"
sh -c "$CMMD"
echo ""
else
echo -e "Expected: fgr <search> [file filter] [grep opt]\n"
fi
}