-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
124 lines (100 loc) · 2.9 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
# Easier navigation: .., ..., ~ and -
alias .1='cd ..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
alias cd..='cd ..'
# Git
alias gt='git'
alias gtcl='git clone'
alias gtco='git checkout'
alias gtpl='git pull'
alias gtph='git push'
alias gtb='git branch'
alias gtst='git status'
# Mercurial
alias hgbg='hg branches | grep'
alias hgb='hg branch'
alias hgud='hg up default'
alias hgu='hg up'
alias hgpl='hg pull'
alias hgm='hg merge'
alias hgmd='hg merge default'
alias hgc='hg ci -m'
alias hgph='hg push'
alias hgphnb='hg push --new-branch'
alias hgi='hg import'
alias hge='hg export -o'
alias hgs='hg st'
alias hgo='hg out'
alias hgh='hg heads .'
# Maven
alias mvncit='mvn clean install'
alias mvnci='mvn clean install -Dmaven.test.skip=true'
# Grunt
alias gw='grunt watch'
# Services
alias rmysql='sudo service mysql start'
alias cmysql='mysql -u root'
# Easier file & directory listing
alias l='ls -CF' # directories and files in columns
alias la='ls -A' # directories and files incl. hidden in columns
alias ll='ls -alF' # everything with extra info as a list
alias lsd='ls -l | grep "^d"' # only directories as a list
alias l.='ls -d .* --color=auto'
# Shortcuts
alias c="clear"
alias v="vim"
alias es="emacs -nw"
alias bc='bc -l' # calculator with math support
alias sha1='openssl sha1' # generate sha1 digest
alias mkdir='mkdir -pv'
alias diff='colordiff'
# Stop after sending count ECHO_REQUEST packets #
alias ping='ping -c 5'
# Do not wait interval 1 second, go fast #
alias fastping='ping -c 100 -s.2'
alias oports='netstat -tulanp'
# do not delete / or prompt if deleting more than 3 files at a time #
#alias rm='rm -I --preserve-root'
# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'
# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
# become root #
alias root='sudo -i'
alias su='sudo -i'
## Archives
alias untar='tar -xvzf'
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Processes
alias psgrep='ps ax | grep'
alias kill9='kill -9'
## pass options to free ##
alias meminfo='free -m -l -t'
## get top process eating memory
alias psmem='ps auxf | sort -nr -k 4'
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
## get top process eating cpu ##
alias pscpu='ps auxf | sort -nr -k 3'
alias pscpu10='ps auxf | sort -nr -k 3 | head -10'
## Get server cpu info ##
alias cpuinfo='lscpu'
## older system use /proc/cpuinfo ##
##alias cpuinfo='less /proc/cpuinfo' ##
## get GPU ram on desktop / laptop##
alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
alias reboot='sudo reboot'
alias apt-get='sudo apt-get'
fi
alias apggen='apg -s -a 1 -m 63 -n 4'