Lesson 1 of 13 · ⏱ 45 min · ✓ Free

Navigation & the Filesystem

Every bioinformatics tool — STAR, GATK, DESeq2, Snakemake — runs from the command line. Before you can use any of them, you need to move around Linux confidently. This lesson teaches you exactly that.

01 The mental model

Everything in Linux lives in one giant tree starting at / — called the root. Your home folder lives at /home/yourusername. You are always "inside" one folder at a time — this is called your working directory. Think of it like standing inside a room in a building: you can look around, walk to another room, or give someone your full address from the front door.

Absolute path — starts from / and works from anywhere.
Relative path — starts from wherever you are right now.

filesystem tree
/                          # root — the top of everything
├── home/
│   └── shajedur/          # your home folder, also written as ~
│       ├── projects/
│       └── data/
├── etc/                   # system configuration files
├── usr/                   # installed programs
└── tmp/                   # temporary files, cleared on reboot
💡

Press Tab to autocomplete folder and file names — and press it twice to see all options. This prevents typos and saves enormous time. Use it constantly.

02 Core navigation commands

Open your Ubuntu terminal now and type along. These are the commands you will use every single day as a bioinformatician.

pwd — Print Working Directory

Shows exactly where you are right now. Run this whenever you feel lost.

bash
pwd
/home/shajedur

ls — List directory contents

Shows everything in your current folder. Flags change what you see and how.

bash
ls                     # basic list
ls -l                  # long format: permissions, owner, size, date
ls -lh                 # same but sizes in KB / MB (human-readable)
ls -a                  # show hidden files (names starting with .)
ls -la                 # long format + hidden files combined
ls -lh ~/projects     # list a specific folder without going there

# Example output of ls -lh
total 24K
drwxr-xr-x 3 shajedur shajedur 4.0K Jun  7 09:12 projects
drwxr-xr-x 2 shajedur shajedur 4.0K Jun  7 08:44 data
-rw-r--r-- 1 shajedur shajedur 1.2K Jun  6 17:30 notes.txt

cd — Change Directory

Move into a different folder. This is how you walk around the filesystem tree.

bash
cd projects                       # go into projects/ (relative path)
cd ..                             # go UP one level to the parent folder
cd ../..                          # go up two levels at once
cd ~                              # go home from anywhere
cd /home/shajedur/projects        # absolute path — works from anywhere
cd -                              # jump back to the previous directory

mkdir — Make Directory

Create new folders. The -p flag lets you create nested folders in one command.

bash
mkdir projects                          # create one folder
mkdir -p projects/rnaseq/data           # create nested folders in one command
mkdir -p ~/bash-linux-practice/scripts  # create your course working directory

Linux has no recycle bin. When you delete a file with rm it is gone permanently. Always double-check before deleting anything. We will cover rm in Lesson 2.

Getting help inside the terminal

bash
man ls           # full manual for ls — press q to quit
ls --help       # quick summary of all flags
which python3   # shows where a program is installed

03 Quick reference

Command What it does Common flags
pwd Print current working directory
ls List files and folders -l long  ·  -h human sizes  ·  -a hidden
cd [path] Move into a directory .. up  ·  ~ home  ·  - previous
mkdir [name] Create a new directory -p create parent dirs too
man [cmd] Read the manual for a command press q to quit
which [cmd] Find where a program is installed

04 Exercises

Open your Ubuntu terminal and complete all four exercises below. Type every command yourself — do not copy-paste. Muscle memory is how you really learn the command line.

Exercise 1 Where am I?

Open a fresh terminal. Find out exactly where you are. Then list everything in your home folder in long format with human-readable file sizes.

💬 Hint: two commands, one after the other.

Show answer
pwd
/home/shajedur

ls -lh ~
total 8.0K
drwxr-xr-x 2 shajedur shajedur 4.0K Jun  7 09:00 Desktop
drwxr-xr-x 2 shajedur shajedur 4.0K Jun  7 09:00 Documents
Exercise 2 Build your working directory

Create the following folder structure in a single command: ~/bash-linux-practice/scripts. Then navigate into it and confirm you are there.

💬 Hint: use mkdir -p to create nested folders in one shot.

Show answer
mkdir -p ~/bash-linux-practice/scripts
cd ~/bash-linux-practice/scripts
pwd
/home/shajedur/bash-linux-practice/scripts
Exercise 3 Navigate up

While inside scripts/, navigate up two levels with a single cd command. Where does that put you? Confirm with pwd.

Show answer
cd ../..
pwd
/home/shajedur
# Two levels up puts you back at your home directory
Exercise 4 · Challenge List without moving

Without navigating away from your home directory, list all files including hidden ones inside /etc. How many items can you see?

💬 Hint: ls accepts a path as an argument — you do not need to cd there first.

Show answer
ls -la /etc
# -l = long format, -a = all including hidden files
# You will see system config files: passwd, hosts, fstab, etc.