Apr
16
Stupid bash_profile tricks
I have a couple of useful tricks saved up in my .bash_profile. I figured I should share them:
alias psgrep='ps auxww | grep -v grep | grep -i'
I use this one all the time.
——
\`if [ \$? != 0 ]; then echo -e '\[\e[01;31m\]:('; fi\`
It looks like line noise, but it’s incredibly useful when added to your $PS1. The prompt checks if the last command had a non-zero return value and prints a red :( to let you know.
——
alias ducks='du -cks * | sort -nr | head -n 10'
I got this one from rdub. Wondering why a directory is taking up so much space? This will list out the top ten largest files.