Quick answer: Most bioinformatics does not run on your laptop. It runs on a lab or cloud server at a terminal, which is why Linux command-line comfort is the single most cited skill in bioinformatics job ads. The core toolkit is small: ssh to reach the machine, a handful of text commands to inspect giant files, tmux to keep long jobs alive, and small scripts to make the whole thing repeatable.
A practical companion to Python for bioinformatics and the bioinformatics file formats guide: Python carries the logic, but Linux carries the workload.
Table of Contents
Why bioinformatics trusts the terminal
Three properties decide how a field works, and the terminal wins all three:
- Files are enormous. A single BAM file can exceed 100 GB. Opening it in a GUI program is not an option; streaming it through a filter that reads a few lines at a time is.
- Work is long-running. An assembly or a variant-calling run can take days on shared hardware you must not occupy with a crashed laptop connection.
- Work must be repeatable. A pipeline is what other people re-run; every click you make is invisible to the person next month. Commands typed into a script are not.
Clusters, grids, and even cloud machines are Linux by default. There is no second language to learn later: the same commands follow you from your laptop to a 500-node cluster.
The core commands
| Command | What it does | Why it matters here |
|---|---|---|
| ls, cd, pwd | move and list directories | orienting inside any project folder |
| less | page through a file without loading it | inspect a 100 GB BAM or 4 GB FASTQ safely |
| head, tail, wc -l | look at edges and count lines | verify a file has the reads you expect |
| grep | search files by pattern | find records, headers, or errors in seconds |
| cut, sort, uniq | slice columns and count occurrences | quick summaries without writing code |
| cp, mv, rm | copy, move, delete with real permissions | careful housekeeping on shared machines |
| man, –help | read each tool’s own documentation | the manual you already have installed |
None of these are exotic; the skill is fluency, not depth. A bioinformatics power user is someone who reaches for grep and sort before reaching for a script.
Text pipelines: the bioinformatics inner loop
The shell’s superpower is composition. Commands read standard input and write standard output, so a pipeline is analysis, live:
# How many reads sit in a FASTQ file? FASTQ has 4 lines per read:
zcat sample.fastq.gz | wc -l | awk '{print $1 / 4}'
# Look at the first two records without loading anything:
zcat sample.fastq.gz | head -n 8
# How many alignments per chromosome? Column 3 of a SAM file:
samtools view aligned.bam | cut -f3 | sort | uniq -c | sort -rn | head
# Which reference transcripts got no hits at all? Compare with grep -v:
grep -v '^@' aligned.sam | cut -f3 | sort -u
Read those as a habit rather than as trivia: inspect (head), summarize (cut, sort, uniq -c), and filter (grep -v) is the loop you will repeat on every dataset, before any real pipeline exists. One convention worth knowing early: FASTQ lines should not be split, so counting lines is safe only because raw reads ship uncompressed between tools or as gzip, not as zip archives that wrap lines differently.
Working on a server: ssh, tmux, long jobs
The pattern that separates lab beginners from lab contributors is surviving a disconnect. A laptop sleep event must not kill a 20-hour alignment step, and for that reason long jobs belong inside a terminal multiplexer:
ssh user@lab-server # get onto the machine
tmux new -s analysis # start a named terminal session
samtools sort -o out.sorted.bam big.bam # work runs inside tmux
# press Ctrl+b then d to detach; the session keeps running
tmux attach -t analysis # reattach from anywhere later
The same advice applies to screen, and on slurm-style clusters the batch system itself plays that role with a submission script. The principle is identical everywhere: the job lives on the server, not in your terminal window; your terminal is just a view onto it. Two related habits matter as much:
- Run a tiny smoke-test first (
head -n 100000 input.fastq > mini.fastq) and iterate on a small file before committing hours of cluster time to a full run. - Sanity check outputs before trusting them:
wc -lthe result,lessthe first records, and verify the row and column counts you expected.
Small scripts beat giant one-liners
When a pipeline exceeds two or three commands, put it in a file:
#!/usr/bin/env bash
# run-count.sh - count records and alignments, exit early on any failure
set -euo pipefail
fastq=$1
bam=$2
echo "reads:" $(zcat "$fastq" | wc -l | awk '{print $1 / 4}')
echo "alignments on chr11:" $(samtools view -c "$bam" chr11)
set -euo pipefail is the one line worth memorizing: stop on the first failure, treat unset variables as errors, and do not let a failed step hide inside a pipe. Quoting "$fastq" keeps filenames with spaces from silently splitting in half.
Conda, containers, and reproducibility
Modern bioinformatics adds two layers on top of plain Linux, both worth naming now so tool documentation makes sense later:
- Conda / bioconda. Tool installation across a shared machine without root and without conflicts, plus an environment file others can recreate.
- Containers. A full toolchain (build with Docker, run anywhere including clusters via Apptainer/Singularity) frozen into an image, so the pipeline runs the same in every lab.
Both exist because Linux gives you the power to install anything and all the ways to shoot yourself doing it. Start with conda; move to containers when your pipeline must survive contact with a different lab’s machine.
Common failure modes
- Running hours of work without tmux. One dropped wifi connection and the pipeline dies at minute 190 of a 200-minute run.
- Even
rmon a shared machine gets no trash bin. The path you delete is the path that is gone; type the full path, look before Enter, and never build a deletion path inside an empty variable. - Filenames with spaces or special characters. They break every pipeline you feed them into; rename with underscores at the moment you create the file.
- Not checking your outputs. A tool exits zero and writes an empty result all the time, which is a real outcome rather than a success.
wc -landflagstat-style summaries belong in every step. - Skipping the smoke test. Iterating on the full 100 GB file means every mistake costs hours instead of seconds.
Key takeaways
- The terminal wins because files are huge, jobs are long, and work must be repeateable; the same commands follow you from laptop to cluster.
- Fluency in fewer than a dozen core commands, especially
less,grep,sort, anduniq -c, covers most day-to-day inspection and summarizing. - Pipes are the inner loop: inspect, summarize, filter, then write the pipeline as a script once it stabilizes.
tmux(orscreen, or the cluster’s batch system) is what keeps a disconnect from killing a long run; smoke tests and output checks are what keep a long run from lying to you.- Conda for environments, containers for full reproducibility; both build on the same terminal skills.
Challenge
Open any recent bioinformatics paper with a methods section and find three steps that were run at a terminal. For each, note the command or tool name and what file format it consumed and produced. If the methods name samtools, bedtools, or a conda environment, you have found the exact skills this article teaches — and how often they appear should tell you their real ranking in the field.
Related: FastQC, fastp and multiqc are all commands you run at a terminal — see the workflow in our read quality control guide.
Want guided practice at a real Linux terminal? Ampersand Academy offers one-to-one mentoring in bioinformatics, Python, and Linux — part of Mahadhi, a development and digital marketing company.
FAQ
Do I need to install Linux to learn bioinformatics?
No. Windows ships WSL and macOS ships a Unix terminal, both of which run everything here. The lab server experience is a later step, not a prerequisite.
Which is better for bioinformatics, tmux or screen?
They solve the same problem and either is fine; pick the one your lab already standardizes on, because the skill is the pattern (long job inside a session), not one specific tool.
How much Linux do I need before Python matters?
Less than people fear. Python scripts run inside that same terminal, so the two skills combine naturally: the shell handles files and jobs, Python handles logic and plotting.
How do I check a huge file without opening it?
Use less, head, or tail; these stream the edges of the file and never load it fully. That single habit is what makes working with very large BAM or FASTQ files possible.
Why does my job die when I close the terminal window?
The job is a child of that terminal session. Run long work inside tmux (or with nohup on the cluster batch system) so it lives on the server rather than in your window.
Is conda still the standard for installing bioinformatics tools?
Yes, conda and bioconda remain the de facto environment tool for shared lab machines, and containers handle the stricter reproducibility cases. Learn one conda workflow first and only move to containers when needed.
Are these skills the same on a cluster?
Yes, with one addition: clusters add a batch system such as slurm that queues and schedules jobs across nodes. The shell skills are unchanged; you just submit the same commands via a script instead of running them interactively.

