-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc
72 lines (56 loc) · 1.95 KB
/
bashrc
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
PS1="\[\e[36m\]\u \[\e[33m\]:\[\e[32m\]\w$\[\e[37m\] "
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PYTHONDONTWRITEBYTECODE=True
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/repos/BUILD_DIR/NETCDF/lib/
export PYSYN_CDBS=$HOME/repos/Spectractor/tests/data
export LIBRADTRANDIR=$HOME/repos/libRadtran-2.0.2/
# export DISPLAY=
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
ignoreeof=3
alias eupss="eups list -s | cut -f-1"
alias eups_local="eups list -s | cut -f-1 | grep LOCAL"
alias count="ls -1 | wc -l"
alias count_all="find -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done"
alias gs="git status"
alias gc="git checkout"
alias gcm="git checkout master"
alias gd="git diff"
alias gl="git log"
alias dirsize="du -hs * | sort -hr"
alias ls='ls --color=auto'
alias ldir='ls -ld */'
alias git-squash-to-base="git reset \$(git merge-base master \$(git rev-parse --abbrev-ref HEAD))"
# cd up to n dirs
# using: cd.. 10 cd.. dir
function cd_up() {
case $1 in
*[!0-9]*) # if no a number
cd $( pwd | sed -r "s|(.*/$1[^/]*/).*|\1|" ) # search dir_name in current path, if found - cd to it
;; # if not found - not cd
*)
cd $(printf "%0.0s../" $(seq 1 $1)); # cd ../../../../ (N dirs)
;;
esac
}
alias 'cd..'='cd_up'
function ggrep(){
grep -r --include="*.py" --exclude-dir="build/" -n --color "$1" . $2
}
function dgrep(){
grep -r --include="*.py" --exclude-dir="build/" -n --color "def $1" . $2
}
function cgrep(){
grep -r --include="*.py" --exclude-dir="build/" -n --color "class $1" . $2
}
function ygrep(){
grep -r --include="*.yaml" --exclude-dir="build/" -n --color "$1" . $2
}
function ipygrep(){
grep -r --include="*.ipynb" --exclude-dir="build/" -n --color "$1" . $2
}