Handy bash commands

Working with multi-thread machine

Compreesion tar cf - paths-to-archive | pigz -9 -p 32 > archive.tar.gz

Ubuntu server commands

Here is a collection of commands relevant to using a remote server that I find helpful. Establish connection ssh -X -p *port* [email protected]_ip ssh command establishes a ssh connection with the server. -X opens an X-server, which allows you to open GUI software (e.g. firefox) on the server and convey the display to your local computer -p selects the specific port the connection is going to be established. Not all ports of a computer are always open for security reasons.

Set up a Ubuntu machine

System Choice I chose Ubuntu 18.04 LTS. Not any earlier version because to my knowledge most, if not all software for bioinformatics analysis will support 18.04. One exception to this is Nanopore’s Albacore base caller, but it is being replaced by Guppy anyways. 18.10 (the current highest version) was not chosen , because the improvements in features do not seem to justify an upgrade away from LTS. Hardware GPU Ubuntu seems to dislike some high-spec GPUs.

All about background tasks

This post will cover how to start running a programme in a terminal’s background monitor the programme and stop the programme I decided to write this post beacuse I did not find any comprehensive tutorial to cover this aspect. start running a programme in a terminal’s background To do so, simply add & at the end of the line. What occurs after the enter is hit is that the first line will be run at the background and the terminal will prompt you another line of input.

The difference between `$PATH` and `echo $PATH`

TL;DR: $PATH will call the value stored in the environmental variable PATH as a command, but echo $PATH will print out the value stored in the variable PATH. How I found out: Recently I have been trying to integrate WSL with RStudio. One thing intrigues me is that the bash in Rmd has a different PATH with WSL. For example, one cannot run the software installed with conda directly from Rmd - the conda bin directory needs to be added into PATH (using export .