-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_aliases
83 lines (75 loc) · 2.36 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
#
# Sample useful aliases for your .bash_aliases file.
#
# Seeing and moving around directories & files
alias ..='cd ..'
alias ....='cd ../..'
alias .3='cd ../../..'
alias back='cd "$OLDPWD"'
alias dirt='ls -aFR'
alias grep='grep --color=auto'
alias l='ls -aF'
alias ll='ls -alF'
alias llround='ls -ahlF'
alias p='pwd'
function _recent() { ls -alt $1 | head;}
alias recent=_recent
alias wcl='wc -l'
alias whence='type'
# Related Aliases that depend on Functions
# grep all files under the current directory
function _grin() { grep -rn --color $1 .;}
alias grin=_grin
# find file by name in (or under) the current directory
function _fn() { find . -name $1;}
alias fn=_fn
# Useful shortcuts
alias a='alias'
alias bye='clear; exit'
alias functions='set | grep "=()" | cut -f1 -d='
alias mysqlAsRoot="mysql --defaults-file=~/.root.cnf"
alias now='date +"%T"'
alias nowdate='date +"%d-%m-%Y"'
alias psg='ps -ef | grep'
#show only my procs
alias psme='ps -ef | grep $USER'
# Using Git
alias branch='git branch'
alias checkout='git checkout'
alias g='git'
alias ga='g add '
alias gc='git commit'
alias gcm='git commit -m'
alias gdiff='git diff --color'
alias gdiffb='git diff -b --color'
alias gfilehist='git log --follow'
alias gl='git log'
alias gldates='git log --pretty=fuller'
alias glp='git log --pretty=format:"%h - %an, %ar : %s"'
alias glrecent='git log -10 --pretty=format:"%h - %an, %ar : %s"'
alias gls='git log --stat'
alias gltags="git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags"
alias gm='git mv'
alias gr='git rm'
alias grmR='git rm -rf'
alias gs='git status'
alias gss='git status --short'
alias gp='git push origin master'
alias gpull='git pull origin master'
alias gtagbydate="git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags"
# Moving towards sysadmin functions
alias df='df -H'
alias du='du -ch'
alias ping='ping -c 5'
alias size='du -h –max-depth=1'
alias untar='tar -zxvf'
# Sysadmin-type functions
alias root='sudo -i'
alias su='sudo -i'
alias svi='sudo vi'
alias reboot='sudo /sbin/reboot'
alias shutdown='sudo /sbin/shutdown'
alias poweroff='sudo /sbin/poweroff'
# poweroff is only on some systems (only Linux, perhaps?)
alias bigfiles="find . -type f 2>/dev/null | xargs du -a 2>/dev/null | awk '{ if ( \$1 > 5000) print \$0 }'"
alias verybigfiles="find . -type f 2>/dev/null | xargs du -a 2>/dev/null | awk '{ if ( \$1 > 500000) print \$0 }'"