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
ch(){
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
https://www.biostars.org/p/45456/
https://github.com/stephenturner/oneliners

Popular posts from this blog

Mass download from google drive using R

Data analysis step 8: Pathway analysis with GSEA

Installing R-4.0 on Ubuntu 18.04 painlessly