Essential Linux Commands

Welcome! This page is your friendly guide to the most useful Linux commands. Each command comes with a simple explanation and a real-world example. Don't worry if you're new, just try these out and you'll feel like a pro in no time!

Explore Files & Folders

pwd

Show your current location (Print Working Directory).

ls -l

See a detailed list of files and folders in your current location.

Pro tip: ls -lh shows file sizes in MB/KB!
cd /path/to/dir

Move into a different folder. Try cd ~ to go home!

ls -a

Show all files, including hidden ones (those starting with a dot).

Create, Copy, Move & Remove

mkdir myfolder

Make a new folder called myfolder.

touch file.txt

Create a new empty file named file.txt.

cp file1.txt file2.txt

Copy file1.txt to file2.txt.

cp -r dir1 dir2

Copy a whole folder and its contents.

mv old.txt new.txt

Rename or move a file or folder.

rm file.txt

Delete a file. Be careful!

rm -r myfolder

Delete a folder and everything inside it.

rmdir myfolder

Remove an empty folder.

View & Edit Files

cat file.txt

Show the contents of a file.

less file.txt

View a file page by page. Press q to quit.

head file.txt

See the first 10 lines of a file.

tail file.txt

See the last 10 lines of a file.

nano file.txt

Edit a file in Nano (easy for beginners).

vim file.txt

Edit a file in Vim (for advanced users).

System Info & Help

whoami

Show your current username.

date

Display the current date and time.

df -h

See disk space usage (human-readable).

free -h

See memory (RAM) usage (human-readable).

man ls

Read the manual for ls (works for most commands).

ls --help

See quick help for any command (try --help with others too!).

Tip: Practice these commands in a safe environment. Don't be afraid to experiment—mistakes are part of learning!