@@ -14,8 +14,6 @@ alias dl="cd ~/Downloads"
1414alias dt=" cd ~/Desktop"
1515alias p=" cd ~/projects"
1616alias g=" git"
17- alias h=" history"
18- alias j=" jobs"
1917
2018# Detect which `ls` flavor is in use
2119if ls --color > /dev/null 2>&1 ; then # GNU `ls`
2927# List all files colorized in long format
3028alias l=" ls -lF ${colorflag} "
3129
32- # List all files colorized in long format, including dot files
33- alias la=" ls -laF ${colorflag} "
30+ # List all files colorized in long format, excluding . and ..
31+ alias la=" ls -lAF ${colorflag} "
3432
3533# List only directories
3634alias lsd=" ls -lF ${colorflag} | grep --color=never '^d'"
@@ -50,12 +48,13 @@ alias sudo='sudo '
5048# Get week number
5149alias week=' date +%V'
5250
53- # Stopwatch
54- alias timer=' echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
55-
5651# Get macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
5752alias update=' sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update; sudo gem cleanup'
5853
54+ # Google Chrome
55+ alias chrome=' /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
56+ alias canary=' /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'
57+
5958# IP addresses
6059alias ip=" dig +short myip.opendns.com @resolver1.opendns.com"
6160alias localip=" ipconfig getifaddr en0"
@@ -70,10 +69,6 @@ alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"
7069# Clean up LaunchServices to remove duplicates in the “Open With” menu
7170alias lscleanup=" /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
7271
73- # View HTTP traffic
74- alias sniff=" sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
75- alias httpdump=" sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \" Host\: .*|GET \/.*\" "
76-
7772# Canonical hex dump; some systems have this symlinked
7873command -v hd > /dev/null || alias hd=" hexdump -C"
7974
@@ -110,9 +105,9 @@ alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && k
110105# URL-encode strings
111106alias urlencode=' python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
112107
113- # Merge PDF files
114- # Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
115- alias mergepdf=' /System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py '
108+ # Merge PDF files, preserving hyperlinks
109+ # Usage: `mergepdf input{1,2,3}.pdf`
110+ alias mergepdf=' gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.pdf '
116111
117112# Disable Spotlight
118113alias spotoff=" sudo mdutil -a -i off"
@@ -122,9 +117,8 @@ alias spoton="sudo mdutil -a -i on"
122117# PlistBuddy alias, because sometimes `defaults` just doesn’t cut it
123118alias plistbuddy=" /usr/libexec/PlistBuddy"
124119
125- # Ring the terminal bell, and put a badge on Terminal.app’s Dock icon
126- # (useful when executing time-consuming commands)
127- alias badge=" tput bel"
120+ # Airport CLI alias
121+ alias airport=' /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
128122
129123# Intuitive map function
130124# For example, to list all directories that contain a certain file:
@@ -133,12 +127,9 @@ alias map="xargs -n1"
133127
134128# One of @janmoesen’s ProTip™s
135129for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
136- alias " $method " =" lwp-request -m '$method '"
130+ alias " ${ method} " =" lwp-request -m '${ method} '"
137131done
138132
139- # Make Grunt print stack traces by default
140- command -v grunt > /dev/null && alias grunt=" grunt --stack"
141-
142133# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
143134alias stfu=" osascript -e 'set volume output muted true'"
144135alias pumpitup=" osascript -e 'set volume output volume 100'"
@@ -151,7 +142,7 @@ alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v exten
151142alias afk=" /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
152143
153144# Reload the shell (i.e. invoke as a login shell)
154- alias reload=" exec $SHELL -l"
145+ alias reload=" exec ${ SHELL} -l"
155146
156147# Print each PATH entry on a separate line
157148alias path=' echo -e ${PATH//:/\\n}'
0 commit comments