#### Search for a running process pg() { emulate -L zsh unsetopt KSH_ARRAYS if [[ -z "$1" ]] ; then echo "any - grep for process(es) by keyword" >&2 echo "Usage: any " >&2 ; return 1 else ps xauwww | grep -i --color=auto "[${1[1]}]${1[2,-1]}" fi } #### Beautiful PATH path() { echo $PATH | tr ":" "\n" | \ awk "{ sub(\"/usr\", \"$fg_no_bold[green]/usr$reset_color\"); \ sub(\"/bin\", \"$fg_no_bold[blue]/bin$reset_color\"); \ sub(\"/opt\", \"$fg_no_bold[cyan]/opt$reset_color\"); \ sub(\"/sbin\", \"$fg_no_bold[magenta]/sbin$reset_color\"); \ sub(\"/local\", \"$fg_no_bold[yellow]/local$reset_color\"); \ print }" } #### All interface ips function myip() { ifconfig lo0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "lo0 : " $2}' ifconfig en0 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en0 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}' ifconfig en0 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en0 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}' ifconfig en1 | grep 'inet ' | sed -e 's/:/ /' | awk '{print "en1 (IPv4): " $2 " " $3 " " $4 " " $5 " " $6}' ifconfig en1 | grep 'inet6 ' | sed -e 's/ / /' | awk '{print "en1 (IPv6): " $2 " " $3 " " $4 " " $5 " " $6}' } # ------------------------------------------------------------------- # nice mount (http://catonmat.net/blog/another-ten-one-liners-from-commandlingfu-explained) # displays mounted drive information in a nicely formatted manner # ------------------------------------------------------------------- function nicemount() { (echo "DEVICE PATH TYPE FLAGS" && mount | awk '$2="";1') | column -t ; }