Shell aliases for bioinformatics

Using shell allows us to take advantage of some nice features to make our bioinformatics lives a little easier for things we do very frequently. In Ubuntu, the ~/.bashrc file is run as a new terminal window is opened to customise the shell. Here are a few of my favourite general shortcuts. Let me know your favourites in the comments section below!

#shorten ls forms
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

#shorten file viewing
alias h='head'
alias t='tail'
alias n='nano -S'
#the -S option to nano makes scrolling smoother
alias nano='nano -S'

#easy update
alias update='sudo apt-get update && sudo apt-get upgrade -y'

#search through history
alias hgrep='history | grep'

#Get col headers of tab delim file
cat $1 | tr '\t' '\n' | nl -n ln
export -f ch

#login with ssh where IP is constant (X is the IP address)
alias login1='ssh -Y username@X.X.X.X'
#scp can be done as above

#login with ssh where IP varies (Y is the MAC address)
alias login2='ssh username@`sudo arp-scan --localnet | grep -i YY:YY:YY:YY:YY:YY | cut -f1`'

#login wake up PC on LAN
alias wake='sudo etherwake -b YY:YY:YY:YY:YY:YY'

#find in the current directory (recursive)
alias ff='find . | grep $1'

#Entertain the kids
alias mario='zsnes -v 4 /home/games/snes/Super_Mario_All-Stars-U-.smc'

Further reading


Popular posts from this blog

Data analysis step 8: Pathway analysis with GSEA

Installing R-4.0 on Ubuntu 18.04 painlessly

EdgeR or DESeq2? Comparing the performance of differential expression tools