forked from sontek/homies
/
_bash_aliases
67 lines (56 loc) · 1.47 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
# Some user added aliases in order of addition.
# If something breaks consider removing the most recent additions.
# SSH
hpcc="smithby1@hpcc.msu.edu"
alias hpcc-ssh="ssh $hpcc"
alias hpcc-sshx="ssh -X $hpcc"
lyorn="smithby1@lyorn.idyll.org"
alias lyorn-ssh="ssh $lyorn"
alias lyorn-sshx="ssh -X $lyorn"
z61t="bjsmith@smithby1-4.user.msu.edu"
alias z61t-ssh="ssh $z61t"
alias z61t-sshx="ssh -X $z61t"
webhost="byronjsm@byronjsmith.com"
alias webhost-ssh="ssh $webhost"
flux="bjsm@flux-login.engin.umich.edu"
alias flux-ssh="ssh $flux"
alias flux-sshx="ssh -X $flux"
# What else?
# Safe copy, mv, and rm
alias cp="cp -i"
alias mv="mv -i"
alias rm="rm -i"
alias rmv="rm -fr"
alias psu="ps -u $USER"
alias ..="cd .."
alias ll="ls -alFh"
alias nmsq="grep -c '^>'"
alias now="date +%r%n%a%t%D"
alias calc="bc -l <<<"
alias view="vim -R"
alias topu="top -u $USER"
function commsrunning {
ps -u $USER -o comm=
}
function name2proc {
echo `ps -u $USER | grep $1 | awk '{print($1)}'`
}
complete -W "`commsrunning`" name2proc
function namekill {
kill `name2proc $1`
}
complete -W "`commsrunning`" namekill
alias cl="column -s ' ' -t"
function tab {
cl $1 | less -S
}
function fastq2fasta {
cat $1 | perl -e '$i=0;while(<>){if(/^\@/&&$i==0){s/^\@/\>/;print;
}elsif($i==1){print;$i=-3}$i++;}'
}
function to_csv {
awk '{for (i=1; i<=(NF - 1); i++) printf $i ","; printf $NF "\n"}' <&0
}
function to_tsv {
awk '{for (i=1; i<=(NF - 1); i++) printf $i "\t"; printf $NF "\n"}' <&0
}