-
Notifications
You must be signed in to change notification settings - Fork 1
/
ccr_macos_bashrc
62 lines (50 loc) · 1.44 KB
/
ccr_macos_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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
### Set prompt
OS=`uname`
PS1='\u $PWD>' #set command line prompt
### Aliases
alias ps='ps -o ruser,pid,pcpu,pmem,vsz,nice,s,stime,time,args'
alias rm="rm -i" #prompt before removing
alias mv="mv -i" #prompt before overwrite
alias cp="cp -i" #prompt before overwrite
alias ll='ls -lhFg' #get file info using ls
alias top='top -M'
### Environmental variables
CLICOLOR=1; export CLICOLOR
LS_COLORS=$LS_COLORS:'di=1;30:' ; export LS_COLORS #display directories in bold blue
LS_COLORS=$LS_COLORS:'ln=0;34:' ; export LS_COLORS #display symbolic links in red
export PATH=/Users/Cassie/.local/bin:$PATH
### Functions
#mount remote file systems
mymt() {
sshfs -o allow_other,defer_permissions,noapplexattr,noappledouble [email protected]:/scratch/ccr5ju ~/Remote/scratch
}
export -f mymt
#unmount remote file systems
myum() {
umount ~/Remote/scratch
}
export -f myum
#cleanup appledouble files
#mkdir .trash
#find ./ -depth -name ".AppleDouble" | sed 's|.//||g' | awk '{print "mkdir .trash/dir"NR; print "mv "$1" .trash/dir"NR}' > .trash/cleanup_appledouble_files.sh
#bash .trash/cleanup_appledouble_files.sh
tally () {
local file=$1
local col=$2
awk -v col=$col '{print $col}' $file | sort | uniq -c
}
export -f tally
comment () {
printf '\n%.0s' {1..5}
printf '=%.0s' {1..100}
echo -e " "
echo -e "\t"$1
printf '=%.0s' {1..100}
echo -e " "
}
export -f comment