-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
136 lines (121 loc) · 3.28 KB
/
.bash_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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
##################################
# Bashstuffs
##################################
##################################
# Editor
###################################
alias editor="vim"
alias svim="sudo vim"
alias tmux="TERM=screen-256color-bce tmux"
##################################
# Commands
###################################
# map some commands to sudo
if [ $UID -ne 0 ]; then
alias reboot="sudo reboot"
alias shutdown="sudo shutdown now"
alias update="sudo apt-get upgrade"
alias upgrade="sudo apt-get upgrade"
alias dist-upgrade="sudo apt-get dist-upgrade"
alias os-update="sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y"
fi
# chorme www.someurl.com
alias chrome="google-chrome"
# create parent directories on demand
alias mkdir='mkdir -pv'
# time
alias now='date +"%T"'
# simple simple server
alias webserver="python -m SimpleHTTPServer 8000"
# better tree
alias tree="tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;"
##################################
# Navegation
##################################
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~"
alias -- -="cd -" # Go back
alias d="cd ~/Documents/"
alias dd="cd ~/Downloads/"
alias dm="cd ~/Music/"
alias dp="cd ~/Pictures"
alias dg="cd ~/Git/"
# commands more interactive
alias rm="rm -i"
alias rd="rmdir"
alias mv="mv -i"
alias cp="cp -i"
# directory listings
alias ls="command ls --color"
alias ll="ls -lF --color=auto"
alias la="ls -alF --color=auto"
alias ls="ls -F"
##################################
# Bundler
##################################
alias b="bundle"
alias be="bundle exec"
alias bi="b install --path vendor"
alias bl="bundle list"
alias bu="bundle update"
alias bp="bundle package"
alias binit="bi && bp && echo 'vendor/ruby' >> .gitignore"
##################################
# Rails
##################################
alias r='rails'
alias rg='rails g'
alias rs='rails s'
alias rc='rails c'
alias rn='rails new'
alias rd='rails dbconsole'
alias rp='rails plugin'
alias ra='rails application'
alias rd='rails destroy'
##################################
# Rake
##################################
alias rt='rake test'
alias rtu='rake test:units'
alias rtf='rake test:functionals'
alias rti='rake test:integration'
alias rr='rake routes'
alias rdbm='rake db:migrate'
alias rdbr='rake db:rollback'
##################################
# Git
##################################
alias g='git'
alias gcl='git clone'
alias ga='git add'
alias gaa='git add .'
alias gs='git status'
alias gss='git status -s'
alias gg='git status'
alias ggg='git status -s'
alias gl='git pull'
alias pull='git pull'
alias gup='git fetch && git rebase'
alias gp='git push'
alias push='git push'
alias gpp='git pull && git push'
alias gpo='git push origin'
alias gd='git diff'
alias gdd='git diff --cached'
alias gdw='git diff --color-words'
alias gdt='git difftool'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gcom='git commit'
alias com='git commit'
alias gb='git branch'
alias gba='git branch -a'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gco='git checkout'
alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'