-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_aliases
More file actions
141 lines (123 loc) · 4.58 KB
/
.bash_aliases
File metadata and controls
141 lines (123 loc) · 4.58 KB
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
137
138
139
140
141
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
alias quota='quota -sQ' # Human readable and ignore NFS errors
# Grep default options, that you don't have to type with the command
grep_options='--color=auto'
for PATTERN in .git .hg .svn .work; do
grep_options="$grep_options --exclude-dir=$PATTERN"
done
alias grep="grep $grep_options"
alias dos2unix='sed "s/$//"'
# ------------------------------------------------------------------------------
# dsg
# ------------------------------------------------------------------------------
alias gadi='ssh -Y [email protected]'
alias awsnemo='ssh -i ~/.ssh/id_rsa_nci_cron_ec2 [email protected]'
alias ebsnemo='ssh -X -i ~/.ssh/landsat-nrt-downloader.pem [email protected]'
# ------------------------------------------------------------------------------
# bash
# ------------------------------------------------------------------------------
alias ll='ls -l'
alias la='ls -la'
alias lr='ls -lacr'
alias lt='ls -latr'
alias ld='ls -ld .*'
alias hg='history | grep'
alias ag='alias | grep'
alias sbr='source ~/.bashrc'
alias lcd='cd $(ls -cr | tail -n 1 )'
# ------------------------------------------------------------------------------
# apt-get
# ------------------------------------------------------------------------------
alias inst='sudo apt-get install'
alias uu='sudo apt-get update && sudo apt-get upgrade'
alias sc='sudo apt-get autoremove'
# ------------------------------------------------------------------------------
# git
# ------------------------------------------------------------------------------
alias ga='git add'
alias gaa='git add -A'
alias gba='git branch --all'
alias gbd='git branch -d'
alias gbD='git branch -D'
alias gbn='git checkout -b'
alias gcann='git commit --amend --no-edit --no-verify'
alias gcl='git clone'
alias gcm='git commit -m'
alias gcam='git commit -am'
alias gco='git checkout'
alias gd='git diff'
alias gdc='git diff --cached'
alias gfa='git fetch --all'
alias gl='git log --branches --remotes --tags --graph --oneline --decorate'
alias gp='git push'
alias gpf='git push -f'
alias gpsuo='git push --set-upstream origin'
alias gpu='git pull'
alias gpuff='git pull --ff-only'
alias gpur='git pull --rebase --autostash'
alias gpurm='git fetch --all && git pull --rebase --autostash origin master'
alias gpurmi='git fetch --all && git rebase --interactive --autostash origin/master'
alias gmm='git fetch --all && git merge origin/master'
alias gr='git rebase --autostash'
alias gri='git rebase --interactive'
alias gra='git rebase --abort'
alias grc='git rebase --continue'
alias grs='git rebase --skip'
alias grv='git remote -v'
alias greh='git reset --hard'
alias gri='git rebase --interactive'
alias grsh='git reset --hard'
alias gs='git status'
alias gstl='git stash list'
alias gst='git stash'
alias gsts='git stash show'
alias gstp='git stash pop'
alias gstpi='git stash pop --index'
alias gsta='git stash apply'
alias gcp='git cherry-pick'
alias gcpc='git cherry-pick --continue'
alias gcpa='git cherry-pick --abort'
alias gc='git-cz'
alias gcr='git-cz --retry'
function pushAll() {
echo What is your message?
read -r commit_message
gaa && gcm "$commit_message" && gp
}
# ------------------------------------------------------------------------------
# yadm
# ------------------------------------------------------------------------------
alias yms='yadm status'
alias yma='yadm add'
alias ymp='yadm push'
alias ymcm='yadm commit -m'
alias ymcam='yadm commit -am'
alias ymd='yadm diff'
alias ymdc='yadm diff --cached'
alias ympu='yadm pull --rebase'
alias ymp='yadm push'
function ymln() {
yadm log "-$1"
}
################################################################################
# tmux
################################################################################
alias t='tmux'
alias tn='tmux new -s'
alias ta='tmux attach -t'
alias tl='tmux ls'
alias tk='tmux kill-session -t'