diff --git a/bash_aliases b/bash_aliases index 346002c929677ad1cdb1b4c715f056500b2580d4..81f30136ee1e032f27656ff4f96ed872f1eead54 100644 --- a/bash_aliases +++ b/bash_aliases @@ -54,35 +54,40 @@ alias dume='du -h --exclude="*.git*" | sort -h' # Make free output more human friendly alias free='free -mt' -# Print a color chart -alias color=' - for x in 0 1 4 5 7 8; - do for i in `seq 30 37`; - do for a in `seq 40 47`; - do echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; - done; - echo; - done; - done; - echo "";' - ################### # Functions # ################### # Count the number of files in a directory and its sub-directories +alias count='count # Count the number of files in a directory and its sub-directories' function count { find $1 -type f | wc -l } # Show a histogram output of commands in history +alias hist='hist # Show a histogram output of commands in history' function hist { - history | awk "{print $2}" | sort -n | uniq -c | sort -n | tail + history | awk '{print $2}' | sort -n | uniq -c | sort -n | tail } # Make a directory, then cd into it +alias mcd='mcd # Make a directory, then cd into it' function mcd { mkdir -pv $1 cd $1 pwd } + +# Print a color chart +alias color='color # Print a color chart' +function color { + for x in 0 1 4 5 7 8; do + for i in `seq 30 37`; do + for a in `seq 40 47`; do + echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "; + done; + echo; + done; + done; + echo ""; +}