Small Bash cheat sheet
Practices and examples
Here are some example commands and things you can try on your own. Always remember:
- use auto completion as often as possible, you can always use the tab/tabulator key to get suggestions for a command you are typing and to auto-complete folder/file names and paths - it's much faster and less error prone! (preventing typos!)
- prevent whitespaces in all folder and file names! You can use whitespaces in general, but it will complicate your work on a Linux system! Use
-
, _
, etc… instead, e.g. new-file.txt
- be always careful when you delete a folder or file! It's not as easy as on windows to get your data back!
Now, open a terminal and try the following commands.
Install conda
- Conda is a packaging manager that will help us to install bioinformatics tools and to handle their dependencies automatically
- In the terminal enter:
- Create and activate a new conda environment
Hint 1: You can create as many environments as you want! It is often convenied to have separate environments for separate tasks, pipelines, or even tools.
Hint 2: An often faster and more stable alternative to conda
is mamba
. Funningly, mamba
can be installed via conda
and then used in the similar way. Just replace conda
then with mamba
(like shown in the bioinformatics tool slides, linked below).
- Here we just install one example tool (NanoPlot) in the environment we just created
You can also install specific versions of a tool!
- important for full reproducibility
- e.g.
conda install nanoplot=v1.40.0
- per default,
conda
will try to install the newest tool version based on your configured channels and system architecture
- you can also create a new environment and install a tool in one step, for example:
conda create -n minimap2 -c bioconda minimap2
Useful additional links