-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bash_alias
66 lines (55 loc) · 2.06 KB
/
.bash_alias
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
#--------------------------------------------------------------------------
# .bash_alias
# bash alias settings
# Copyright (c) 2010-2025, Michael Paquier
#
# Place to define public alias definitions
#--------------------------------------------------------------------------
# Enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto -h '
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto --directories=skip'
alias xgrep="xargs grep --color -d skip"
else
# Add defaults if colors are not supported
alias ls='ls -h'
alias grep='grep --directories=skip'
alias xgrep="xargs grep -d skip"
fi
# General aliases
alias rm='rm -f'
alias du='du -h'
alias dc='cd'
alias df='df -h'
alias vi='vim'
alias cdw='cd `pwd`'
alias diff='diff -uNrp'
alias python="python2.7"
# On Windows, use window mode because terminal sucks
if [[ $HOME_ENV_NAME != MINGW* ]]; then
alias emacs='emacs -nw'
fi
alias emasc='emacs'
# Kill attrociously all the Postgres process
alias fuck='killall -9 postgres'
# Shortcut when compiling Postgres extensions with PGXS
alias makepg="make USE_PGXS=1"
# Detect Postgres process
alias pspg="ps ux | head -n1 && ps ux | grep --directories=skip postgres | grep -v 'grep --directories'"
# Process all regression tests in Postgres at full speed
alias pgcheck="cd \$HOME_POSTGRES_SRC && make check-world -j 4 PROVE_FLAGS='-j 4' && echo result: \$?"
# Compile from scratch and run all tests in Postgres
alias pgall="cd \$HOME_POSTGRES_SRC && git menage && pg_compile 2> compile.txt && pgcheck"
# Compile only documentation
alias pgdocs="cd \$HOME_POSTGRES_SRC && git menage && pg_compile -c && cd doc/ && make html"
# Attach psql process to debugger, useful for client-side debugging.
if [[ $HOME_ENV_NAME == Darwin ]]; then
alias psql_dbg="lldb -p \`pgrep psql\`"
elif [[ $HOME_ENV_NAME == Linux ]]; then
alias psql_dbg="gdb attach \`pgrep psql\`"
fi
# Redirect to root location of a git folder
alias githome="cd \`git root\`"