Skip to content
Newer
Older
100644 127 lines (97 sloc) 4.92 KB
ff5863d @user996015 .aliases: Add `....` and `.....`
user996015 authored Jun 15, 2012
1 # Easier navigation: .., ..., ...., ....., ~ and -
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
2 alias ..="cd .."
3 alias ...="cd ../.."
ff5863d @user996015 .aliases: Add `....` and `.....`
user996015 authored Jun 15, 2012
4 alias ....="cd ../../.."
5 alias .....="cd ../../../.."
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
6 alias ~="cd ~" # `cd` is probably faster to type though
7 alias -- -="cd -"
8
e4001cc @mathiasbynens Add `urlencode` alias
authored Feb 7, 2012
9 # Shortcuts
10 alias d="cd ~/Documents/Dropbox"
c600335 @user996015 .aliases: Add `dl`
user996015 authored Sep 14, 2012
11 alias dl="cd ~/Downloads"
dd95959 @user996015 .aliases: Add `dt`
user996015 authored Sep 13, 2012
12 alias dt="cd ~/Desktop"
e4001cc @mathiasbynens Add `urlencode` alias
authored Feb 7, 2012
13 alias p="cd ~/Projects"
14 alias g="git"
b0fd265 @user996015 .aliases: Add `h` (`history`) and `j` (`jobs`)
user996015 authored Jun 15, 2012
15 alias h="history"
16 alias j="jobs"
e4001cc @mathiasbynens Add `urlencode` alias
authored Feb 7, 2012
17 alias v="vim"
18 alias m="mate ."
6736ec3 @jessejlt TextMate is awesome, but it would be nice to have a SublimeText alias…
jessejlt authored Mar 31, 2012
19 alias s="subl ."
bc6e238 @mathiasbynens .aliases: Better organization
authored Apr 12, 2012
20 alias o="open"
21 alias oo="open ."
22
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
23 # Detect which `ls` flavor is in use
1dec7d8 @janmoesen .aliases: Optimize the `ls` flavor detection even further
janmoesen authored Jul 23, 2012
24 if ls --color > /dev/null 2>&1; then # GNU `ls`
cf79d2c @mathiasbynens .aliases: Optimize the way we detect the `ls` flavor
authored Jul 23, 2012
25 colorflag="--color"
1dec7d8 @janmoesen .aliases: Optimize the `ls` flavor detection even further
janmoesen authored Jul 23, 2012
26 else # OS X `ls`
27 colorflag="-G"
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
28 fi
29
bc6e238 @mathiasbynens .aliases: Better organization
authored Apr 12, 2012
30 # List all files colorized in long format
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
31 alias l="ls -l ${colorflag}"
e4001cc @mathiasbynens Add `urlencode` alias
authored Feb 7, 2012
32
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
33 # List all files colorized in long format, including dot files
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
34 alias la="ls -la ${colorflag}"
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
35
99afefd @yaykyle Added "lsd" to list only directories
yaykyle authored Sep 8, 2011
36 # List only directories
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
37 alias lsd='ls -l ${colorflag} | grep "^d"'
99afefd @yaykyle Added "lsd" to list only directories
yaykyle authored Sep 8, 2011
38
73269b4 @mathiasbynens Steal some nifty aliases from @janmoesen/tilde.
authored Oct 22, 2011
39 # Always use color output for `ls`
4169a34 @mathiasbynens .aliases: Detect which `ls` flavor is in use and use the appropriate …
authored Jul 22, 2012
40 alias ls="command ls ${colorflag}"
3679916 @mathiasbynens .aliases: Support colorized output for `ls` 8.17 only (GNU coreutils)
authored Jul 19, 2012
41 export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
73269b4 @mathiasbynens Steal some nifty aliases from @janmoesen/tilde.
authored Oct 22, 2011
42
bb8de8b @mathiasbynens .aliases: Enable sudo with aliases
authored Mar 25, 2012
43 # Enable aliases to be sudo’ed
44 alias sudo='sudo '
45
1aeba0c @mathiasbynens .aliases: Add `gurl` for Gzip-enabled `curl`
authored Aug 27, 2012
46 # Gzip-enabled `curl`
47 alias gurl="curl --compressed"
48
f430943 @mathiasbynens .aliases: Make `update` update Ruby gems as well
authored Sep 18, 2012
49 # Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
50 alias update='sudo softwareupdate -i -a; brew update; brew upgrade; npm update npm -g; npm update -g; sudo gem update'
b78d8cf @mathiasbynens .aliases: Add `update` alias
authored Mar 26, 2012
51
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
52 # IP addresses
53 alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
54 alias localip="ipconfig getifaddr en1"
475039d @richo .aliases: Make `ips` show IPv6 addresses as well
richo authored May 23, 2012
55 alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
958517d @mathiasbynens Replace the `server` alias with a function that optionally takes an a…
authored Dec 31, 2011
56
57 # Enhanced WHOIS lookups
ce82a18 @mathiasbynens Add a more convenient `whois` alias.
authored Oct 5, 2011
58 alias whois="whois -h whois-servers.net"
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
59
60 # Flush Directory Service cache
93e6bca @jfmercer .aliases: Make `flush` kill `mDNSResponder` as well
jfmercer authored Aug 23, 2012
61 alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
62
a149de5 @porada .aliases: Add `lscleanup` alias that cleans up LaunchServices
porada authored Jul 29, 2012
63 # Clean up LaunchServices to remove duplicates in the “Open With” menu
64 alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
65
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
66 # View HTTP traffic
67 alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
68 alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
69
f8e2a7d @mathiasbynens Use `hd` alias for canonical hex dump. Thanks, @janmoesen!
authored Oct 22, 2011
70 # Canonical hex dump; some systems have this symlinked
559ccb5 @clawfire .aliases: Use `command -v` instead of `type -t`
clawfire authored Aug 2, 2012
71 command -v hd > /dev/null || alias hd="hexdump -C"
73269b4 @mathiasbynens Steal some nifty aliases from @janmoesen/tilde.
authored Oct 22, 2011
72
73 # OS X has no `md5sum`, so use `md5` as a fallback
559ccb5 @clawfire .aliases: Use `command -v` instead of `type -t`
clawfire authored Aug 2, 2012
74 command -v md5sum > /dev/null || alias md5sum="md5"
f8e2a7d @mathiasbynens Use `hd` alias for canonical hex dump. Thanks, @janmoesen!
authored Oct 22, 2011
75
af441ca @eins78 .aliases: Alias `sha1sum` if needed
eins78 authored Sep 14, 2012
76 # OS X has no `sha1sum`, so use `shasum` as a fallback
77 command -v sha1sum > /dev/null || alias sha1sum="shasum"
78
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
79 # Trim new lines and copy to clipboard
80 alias c="tr -d '\n' | pbcopy"
81
b4d4223 @mathiasbynens Add `cleanup` alias, which recursively deletes `.DS_Store` files. Use…
authored Oct 22, 2011
82 # Recursively delete `.DS_Store` files
2a65d95 @clee Shift the '-type f' argument before the '-name' argument in `find` to…
clee authored Feb 8, 2012
83 alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
b4d4223 @mathiasbynens Add `cleanup` alias, which recursively deletes `.DS_Store` files. Use…
authored Oct 22, 2011
84
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
85 # ROT13-encode text. Works for decoding, too! ;)
86 alias rot13='tr a-zA-Z n-za-mN-ZA-M'
87
b3241b2 @mathiasbynens Make `emptytrash` empty the trash for mounted external volumes too
authored Dec 29, 2011
88 # Empty the Trash on all mounted volumes and the main HDD
b0c2aee @mathiasbynens .aliases: Make `emptytrash` clear Apple System Logs
authored Feb 8, 2012
89 # Also, clear Apple’s System Logs to improve shell startup speed
90 alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
cb0eb51 @mathiasbynens Add `emptytrash` alias.
authored Sep 21, 2011
91
a4767da @mathiasbynens Add aliases to show/hide hidden files in Finder. Closes #15.
authored Sep 17, 2011
92 # Show/hide hidden files in Finder
93 alias show="defaults write com.apple.Finder AppleShowAllFiles -bool true && killall Finder"
94 alias hide="defaults write com.apple.Finder AppleShowAllFiles -bool false && killall Finder"
95
5972807 @mathiasbynens Add aliases to hide/show all desktop icons.
authored Sep 20, 2011
96 # Hide/show all desktop icons (useful when presenting)
97 alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
98 alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
99
e4001cc @mathiasbynens Add `urlencode` alias
authored Feb 7, 2012
100 # URL-encode strings
101 alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
102
5c3306c @oschrenk .aliases: Add `mergepdf` alias that concatenates PDF files
oschrenk authored Jul 31, 2012
103 # Merge PDF files
104 # Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
105 alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
106
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
107 # Disable Spotlight
108 alias spotoff="sudo mdutil -a -i off"
109 # Enable Spotlight
110 alias spoton="sudo mdutil -a -i on"
111
56e6431 @mathiasbynens Add PlistBuddy alias, because sometimes `defaults` just doesn’t cut it.
authored Sep 24, 2011
112 # PlistBuddy alias, because sometimes `defaults` just doesn’t cut it
113 alias plistbuddy="/usr/libexec/PlistBuddy"
114
67cb085 @porada .aliases: Add `badge`
porada authored Aug 14, 2012
115 # Ring the terminal bell, and put a badge on Terminal.app’s Dock icon
116 # (useful when executing time-consuming commands)
117 alias badge="tput bel"
118
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
119 # One of @janmoesen’s ProTip™s
6b75bfc @mathiasbynens Use tabs instead of double-space indents
authored Dec 28, 2011
120 for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
121 alias "$method"="lwp-request -m '$method'"
122 done
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
123
124 # Stuff I never really use but cannot delete either because of http://xkcd.com/530/
125 alias stfu="osascript -e 'set volume output muted true'"
e836db3 @alex-humphreys Maximum set volume is 7, not 10
alex-humphreys authored May 21, 2012
126 alias pumpitup="osascript -e 'set volume 7'"
7d02270 @mathiasbynens Initial commit.
authored Sep 5, 2011
127 alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
Something went wrong with that request. Please try again.