Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 90 lines (68 sloc) 3.455 kB
7d02270 @mathiasbynens Initial commit.
authored
1 # Easier navigation: .., ..., ~ and -
2 alias ..="cd .."
3 alias ...="cd ../.."
4 alias ~="cd ~" # `cd` is probably faster to type though
5 alias -- -="cd -"
6
7 # List all files colorized in long format, including dot files
8 alias la="ls -Gla"
9
99afefd @yaykyle Added "lsd" to list only directories
yaykyle authored
10 # List only directories
11 alias lsd='ls -l | grep "^d"'
12
73269b4 @mathiasbynens Steal some nifty aliases from @janmoesen/tilde.
authored
13 # Always use color output for `ls`
14 if [[ "$OSTYPE" =~ ^darwin ]]; then
15 alias ls="command ls -G"
16 else
17 alias ls="command ls --color"
18 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:'
19 fi
20
34b9fcc @mathiasbynens Add `undopush` alias.
authored
21 # Undo a `git push`
22 alias undopush="git push -f origin HEAD^:master"
23
7d02270 @mathiasbynens Initial commit.
authored
24 # IP addresses
25 alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
26 alias localip="ipconfig getifaddr en1"
27 alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
ce82a18 @mathiasbynens Add a more convenient `whois` alias.
authored
28 alias whois="whois -h whois-servers.net"
7d02270 @mathiasbynens Initial commit.
authored
29
30 # Flush Directory Service cache
31 alias flush="dscacheutil -flushcache"
32
33 # View HTTP traffic
34 alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'"
35 alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\""
36
37 # Start an HTTP server from a directory
38 alias server="open http://localhost:8080/ && python -m SimpleHTTPServer 8080"
39
f8e2a7d @mathiasbynens Use `hd` alias for canonical hex dump. Thanks, @janmoesen!
authored
40 # Canonical hex dump; some systems have this symlinked
73269b4 @mathiasbynens Steal some nifty aliases from @janmoesen/tilde.
authored
41 type -t hd > /dev/null || alias hd="hexdump -C"
42
43 # OS X has no `md5sum`, so use `md5` as a fallback
44 type -t md5sum > /dev/null || alias md5sum="md5"
f8e2a7d @mathiasbynens Use `hd` alias for canonical hex dump. Thanks, @janmoesen!
authored
45
7d02270 @mathiasbynens Initial commit.
authored
46 # Trim new lines and copy to clipboard
47 alias c="tr -d '\n' | pbcopy"
48
b4d4223 @mathiasbynens Add `cleanup` alias, which recursively deletes `.DS_Store` files. Use…
authored
49 # Recursively delete `.DS_Store` files
2f93c73 @mathiasbynens Make `cleanup` list the files it deletes. Kind of like how `rm -v` wo…
authored
50 alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
b4d4223 @mathiasbynens Add `cleanup` alias, which recursively deletes `.DS_Store` files. Use…
authored
51
7d02270 @mathiasbynens Initial commit.
authored
52 # Shortcuts
53 alias d="cd ~/Documents/Dropbox"
54 alias p="cd ~/Projects"
55 alias g="git"
56 alias v="vim"
57 alias m="mate ."
58
59 # File size
60 alias fs="stat -f \"%z bytes\""
61
62 # ROT13-encode text. Works for decoding, too! ;)
63 alias rot13='tr a-zA-Z n-za-mN-ZA-M'
64
cb0eb51 @mathiasbynens Add `emptytrash` alias.
authored
65 # Empty the Trash
66 alias emptytrash="rm -rfv ~/.Trash"
67
a4767da @mathiasbynens Add aliases to show/hide hidden files in Finder. Closes #15.
authored
68 # Show/hide hidden files in Finder
69 alias show="defaults write com.apple.Finder AppleShowAllFiles -bool true && killall Finder"
70 alias hide="defaults write com.apple.Finder AppleShowAllFiles -bool false && killall Finder"
71
5972807 @mathiasbynens Add aliases to hide/show all desktop icons.
authored
72 # Hide/show all desktop icons (useful when presenting)
73 alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
74 alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
75
7d02270 @mathiasbynens Initial commit.
authored
76 # Disable Spotlight
77 alias spotoff="sudo mdutil -a -i off"
78 # Enable Spotlight
79 alias spoton="sudo mdutil -a -i on"
80
56e6431 @mathiasbynens Add PlistBuddy alias, because sometimes `defaults` just doesn’t cut it.
authored
81 # PlistBuddy alias, because sometimes `defaults` just doesn’t cut it
82 alias plistbuddy="/usr/libexec/PlistBuddy"
83
7d02270 @mathiasbynens Initial commit.
authored
84 # One of @janmoesen’s ProTip™s
f8ac373 @mathiasbynens Add TRACE and OPTIONS aliases.
authored
85 for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do alias "$method"="lwp-request -m '$method'"; done
7d02270 @mathiasbynens Initial commit.
authored
86
87 # Stuff I never really use but cannot delete either because of http://xkcd.com/530/
88 alias stfu="osascript -e 'set volume output muted true'"
89 alias pumpitup="osascript -e 'set volume 10'"
90 alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
Something went wrong with that request. Please try again.