This blog covers 15 commands for moving around and working with files — the ones you'll type more than any others.

pwd — where am I

Prints the full path of the folder you're currently in.

pwd
/home/user

ls — list what's in a folder

Plain ls just names things. Add flags for more detail.

ls
Documents  Downloads  Music  Pictures  Videos  Templates  Public  projects

-l gives a long listing: permissions, owner, size, date.

ls -l
drwxr-xr-x  4 user user 4096 Aug 21 21:44 Desktop
drwxr-xr-x  4 user user 4096 Jul 13 23:27 Documents
drwxr-xr-x  2 user user 4096 Aug 18 23:01 Downloads
drwxr-xr-x  2 user user 4096 Sep 28  2025 Music
drwxr-xr-x  2 user user 4096 Aug 14 01:10 Pictures

-a adds hidden files — anything starting with a dot, like config files — which plain ls skips.

ls -la
drwxr-x--- 12 user user 4096 Aug 16 01:29 .
drwxr-xr-x  3 root root 4096 Sep 28  2025 ..
-rw-------  1 user user 20773 Aug 21 21:45 .bash_history
-rw-r--r--  1 user user   220 Mar 31  2024 .bash_logout
-rw-r--r--  1 user user  4092 Aug 15 01:59 .bashrc
drwx------  2 user user  4096 Oct  2 2025 .ssh
drwxr-xr-x  4 user user  4096 Aug 21 21:44 Desktop
drwxr-xr-x  4 user user  4096 Jul 13 23:27 Documents

The first two entries, . and .., always show up — they mean "this folder" and "the folder above it."

mkdir — make a folder

mkdir ~/test_dir

Creates test_dir inside your home folder. No output means it worked.

cd — move into a folder

cd ~/test_dir
pwd
/home/user/test_dir

~ always means your home folder, so cd ~ takes you home from anywhere. cd .. moves up one level.

touch — create an empty file

touch sample.txt
ls
sample.txt

If the file already exists, touch just updates its timestamp instead of erasing it — worth knowing so it doesn't surprise you later.

cat — print a file's contents

echo "Hello from Linux" > sample.txt
cat sample.txt
Hello from Linux

The echo "..." > part isn't cat — it's writing a line into the file first, so cat has something to show.

head — first lines of a file

seq 1 20 > numbers.txt
head numbers.txt
1
2
3
4
5
6
7
8
9
10

Default is 10 lines. Ask for a specific number with -n:

head -n 3 numbers.txt
1
2
3

tail — last lines of a file

tail numbers.txt
11
12
13
14
15
16
17
18
19
20

Same -n flag works here too:

tail -n 3 numbers.txt
18
19
20

tail is the one you'll reach for most in practice — checking the end of a log file to see what just happened, without printing the whole thing.

cp — copy a file

cp sample.txt sample_copy.txt
ls
numbers.txt  sample_copy.txt  sample.txt

mv — move or rename a file

mv does both jobs — moving a file and renaming it are the same operation to Linux, just with a different destination.

mv sample_copy.txt renamed.txt
ls
numbers.txt  renamed.txt  sample.txt

find — search for files

find . -name "*.txt"
./numbers.txt
./sample.txt
./renamed.txt

. means "start searching from here." -name "*.txt" matches anything ending in .txt.

file — check what type a file actually is

file sample.txt
sample.txt: ASCII text

Useful when a file has no extension, or you don't trust the extension it has — file looks at the actual content, not the name.

less — view a file one screen at a time

less numbers.txt

Opens the file in a scrollable view instead of dumping everything at once like cat. Arrow keys or space to scroll, q to quit. Better than cat for anything longer than a screen.

rm — delete a file

rm renamed.txt
ls
numbers.txt  sample.txt

rm deletes immediately — there's no trash bin, no confirmation, no undo. To delete a folder and everything in it, add -r (recursive):

rm -r ~/test_dir

Type the path carefully before hitting enter. This is the one command on this list worth double-checking every single time.

man — read a command's manual

man ls
LS(1)                     User Commands                     LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List information about the FILEs (the current directory
       by default). Sort entries alphabetically if none of
       -cftuvSUX nor --sort is specified.

Every command that ships with Linux has a manual page like this, describing what it does and every flag it accepts.