// Linux Basics

Your first 10 Linux commands

Find your way around the shell without memorising a textbook.

Welcome to the blinking cursor. The shell is a text interface to your computer: type a command, press Enter, and see its response. These examples are safe to run in your own account.

See where you are

pwd

pwd prints the present working directory. On a fresh login you might see /home/col or another home directory.

List files

ls
ls -lah

The second command includes hidden files (-a), details (-l), and human-friendly sizes (-h). Names starting with . are hidden by convention.

Change directories

cd ~/Documents
cd ..
cd ~

~ means your home folder. .. means the parent folder. Press Tab to complete a file or directory name.

Read and create text

printf 'Hello from DarkPC!\n' > ~/darkpc-hello.txt
cat ~/darkpc-hello.txt
less ~/darkpc-hello.txt

> overwrites a file; >> appends instead. Press q to leave less.

Make a practice folder

mkdir -p ~/darkpc-practice
cp ~/darkpc-hello.txt ~/darkpc-practice/
ls ~/darkpc-practice

mkdir makes a directory and cp copies a file. We keep everything inside your home folder for safety.

Inspect the machine

whoami
uname -r
date
df -h

These show your username, kernel version, time, and disk space.

Find out what a command does

man ls
ls --help

Read the manual with man; leave using q. Some commands do not support --help, but man is a good first stop.

Quick win: learn pwd, ls, cd, cat, less, mkdir, cp, whoami, date, and man. That is enough to start exploring.

Useful official references