-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
107 lines (85 loc) · 3.57 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
alias ls='ls -GFhl'
alias cp='cp -iv'
alias mv='mv -iv'
alias mkdir='mkdir -pv'
alias la='ls -FGlAhp'
alias less='less -FSRXc'
# Easier navigation
alias .='echo $PWD'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ..l/' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
alias ~="cd ~"
# Shortcuts
alias dropbox="cd ~/Dropbox"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias work="cd ~/projects"
alias etc="cd /usr/local/etc"
alias scorum="cd ~/projects/scorum"
alias g="git"
alias w='which'
alias q="exit"
alias h='history'
alias j="jobs"
# PS
alias psa="ps aux"
alias psg="ps aux | grep "
alias psr='ps aux | grep ruby'
alias psn='ps aux | grep node'
# Vagrant
alias vag='vagrant'
alias vagup='vagrant up'
alias vagdestroy='vagrant destroy'
alias vagssh='vagrant ssh'
alias vaghalt='vagrant halt'
# Docker
alias d='docker $*'
alias d-c='docker-compose $*'
# Redis
alias redis-start='brew services start redis'
alias redis-stop='brew services stop redis'
# Mongo
alias mongo-start='brew services start mongodb'
alias mongo-stop='brew services stop mongodb'
# Enable aliases to be sudo’ed
alias sudo='sudo '
# Get macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
alias 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'
# Homebrew
alias brewu='brew update && brew upgrade --all && brew cleanup && brew prune && brew doctor'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# Show/hide hidden files in Finder
alias showFiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hideFiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Simulator
alias simulator='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app'
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Network
alias ports="lsof -iTCP -sTCP:LISTEN -P"
alias mac-address-wired="ifconfig en0 | grep ether"
alias mac-address-wireless="ifconfig en1 | grep ether"
# File size
alias fs="stat -f \"%z bytes\""
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# Open Sublime
alias subl='/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'
# Open VSCode
alias vsc='/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code'
# NPM
alias npm-default='npm config set registry https://registry.npmjs.org'
alias npm-local='npm config set registry http://localhost:4873/'