-
Notifications
You must be signed in to change notification settings - Fork 2
/
aliases-default.sh
87 lines (74 loc) · 2.42 KB
/
aliases-default.sh
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
alias ipout='dig +short myip.opendns.com @resolver1.opendns.com 2>/dev/null || echo "No internet connection"'
alias ip="echo -e Internal IP Address: ; ipin; echo -e Public facing IP Address: ; ipout ; echo ;"
alias ips="ip"
alias ipin="getIpIn"
alias ports='netstat -tulanp'
# Tip imported from Mathias Bynens' dotfiles
# https://github.com/mathiasbynens/dotfiles/blob/master/.aliases
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -FGlAhp'
alias ls='ls -FA'
alias lh='ls -lisAdGl .[^.]*'
alias lsd='ll | grep "^d" --color=never' # ls for only directories
alias lsf='ll | grep "^[^d]" --color=no' # ls for only files
alias ~="cd ~"
alias root="cd /"
alias ..='cd ..'
alias cd..='cd ..'
alias .2="cd ../../"
alias .3="cd ../../../"
alias .4="cd ../../../../"
alias .5="cd ../../../../../"
alias .6="cd ../../../../../../"
alias .7="cd ../../../../../../../"
alias www="cd /var/www/"
alias desktop='cd ~/Desktop'
alias desk='cd ~/Desktop'
alias d='cd ~/Documents'
alias docs='cd ~/Documents'
alias documents='cd ~/Documents'
alias downloads='cd ~/Downloads'
alias down='cd ~/Downloads'
alias reloadprofiler='source ~/.bash_profile'
alias reloadbashrc='source ~/.bashrc'
alias reload="exec ${SHELL} -l"
alias h='history'
alias today='date +"%d-%m-%Y"'
if [ -n "now" ]; then
alias now='date +"%T"'
fi
alias commit="git commit -a"
alias commitAll="git add -A; git commit -a"
alias gitlog="git log --graph --decorate --oneline"
alias gittree="git log --graph --decorate --oneline --all"
alias checkout="git checkout"
alias push="git push origin"
alias pull="git pull origin"
# Use Git’s colored diff when available
hash git &>/dev/null;
if [ $? -eq 0 ]; then
function diff() {
git diff --no-index --color-words "$@";
}
fi;
alias sizes="sudo du -cxhd 1"
alias aliases='alias'
alias amionline="ping www.google.com -c 1 2>/dev/null >/dev/null && echo \"Yes\" || echo \"No\""
alias amioffline="ping www.google.com -c 1 2>/dev/null >/dev/null && echo \"No\" || echo \"Yes\""
alias ifactive="ifActive"
alias chown='chown --preserve-root'
alias chgrp='chgrp --preserve-root'
alias rm="/bin/rm -i"
alias exit="exit && echo 0 > ~/.uis"
#Requests
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
alias "${method}"="lwp-request -m '${method}'"
done
function bold () {
echo "$(tput bold)$@$(tput sgr0)"
}
alias bold="bold"