Robert R Evans | 76ed68d | 2010-10-02 12:29:17 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 3 | function rh { |
| 4 | history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head |
| 5 | } |
| 6 | |
| 7 | function ips { |
| 8 | ifconfig | grep "inet " | awk '{ print $2 }' |
| 9 | } |
| 10 | |
| 11 | |
| 12 | # View man documentation in Preview |
| 13 | pman () { |
| 14 | man -t "${1}" | open -f -a /Applications/Preview.app/ |
| 15 | } |
| 16 | |
| 17 | |
| 18 | pcurl() { |
| 19 | curl "${1}" | open -f -a /Applications/Preview.app/ |
| 20 | } |
| 21 | |
| 22 | pri() { |
| 23 | ri -T "${1}" | open -f -a /Applications/Preview.app/ |
| 24 | } |
| 25 | |
| 26 | |
| 27 | # disk usage per directory |
| 28 | usage () |
| 29 | { |
| 30 | if [ $1 ] |
| 31 | then |
| 32 | du -hd $1 |
| 33 | else |
| 34 | du -hd 1 |
| 35 | fi |
| 36 | } |