-
Notifications
You must be signed in to change notification settings - Fork 0
/
.profile
71 lines (55 loc) · 1.41 KB
/
.profile
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
echo "Loading .profile"
# COMMON PROFILE
# ============================================================================
# Link
# ============================================================================
alias pp="pwd"
alias rm="rm -i"
alias lm='less -M'
# for aliases with parameters like $1, need to create functions
ll() {
ls -lh $1 && echo "" && pwd
}
lld() {
ls -lh $1 | grep 'dr'
}
alias lla="ls -al"
alias lls="ls -CF"
# use git's aliases (~/.gitconfig)
# alias gits="git status"
# alias gitsu="git status --untracked-files=no"
c() {
builtin cd "$*" && ll
}
alias b="c ../"
alias bb="c ../.."
alias bbb="c ../../.."
## brew install tree
alias tree="tree -C"
function knit() {
R -e "rmarkdown::render('$1', 'all')"
}
function count() {
# usage: count 4 file.csv
# shows count of nth field in file
cut -f $1 -d , $2 | sort | uniq -c
}
function hdrs() {
# usage hdrs file.csv
# number the columns from header, for use with count()
head -n 1 $1 | tr ',' '\n' | nl
}
# ============================================================================
# Load
# ============================================================================
# local settings (checkout from different git branch)
if [ -f ~/.profile_local ]; then
. ~/.profile_local
fi
# private items
if [ -f ~/.profile_private ]; then
. ~/.profile_private
fi
# color output
# works in multiple shells
export CLICOLOR=1