TECHRUNBOOK · PRACTICAL GUIDE

50 Essential Linux Commands for Beginners

Learn 50 essential Linux commands with practical examples for students, IT professionals, developers, system administrators, DevOps engineers and technology enthusiasts.

Practical Runbook Linux & System Administration
50 Commands Beginner Friendly Practical Examples
Have a Linux question? Post your issue to the TechRunbook Community and get help from other IT professionals.
Ask the Community →
! Why learn Linux commands?

Linux commands are fundamental for system administration, cloud computing, DevOps, cybersecurity, networking and IT troubleshooting.

What you'll learn

Learn 50 commands covering files, permissions, processes, networking, SSH, archives, packages, services and logs.

Recommended approach

Practice commands in a safe Linux environment and learn how to combine them using pipes and redirection.

TechRunbook approach: Don't try to memorize every command. Use these commands to solve real problems and gradually build command-line fluency.
01

pwd — Print Working Directory

The pwd command displays the directory you are currently working in.

pwd

Example output:

/home/user/projects
02

ls — List Files and Directories

Use ls to view files and directories.

ls
ls -l
ls -la
ls -lah

The -l option displays detailed information, while -a includes hidden files and -h displays sizes in a human-readable format.

03

cd — Change Directory

The cd command moves you between directories.

cd /var/log
cd ~
cd ..
cd -
04

mkdir — Create a Directory

mkdir projects
mkdir -p projects/linux/scripts

The -p option creates parent directories when they don't already exist.

05

touch — Create a File

touch notes.txt
touch file1.txt file2.txt file3.txt
06

cp — Copy Files and Directories

cp notes.txt backup.txt
cp -r projects projects-backup
07

mv — Move or Rename Files

mv report.txt /home/user/documents/
mv oldname.txt newname.txt

The same command can be used to move a file or rename it.

08

rm — Remove Files

rm oldfile.txt
rm -r old-directory
Warning: Be extremely careful with rm. Files removed from the command line may not be recoverable through the normal desktop trash.
09

rmdir — Remove Empty Directories

rmdir old-folder
10

cat — Display File Contents

cat notes.txt

For large files, use less instead.

11

less — Read Files Page by Page

less logfile.txt

Press q to exit.

12

head — Display the Beginning of a File

head file.txt
head -n 20 file.txt
13

tail — Display the End of a File

tail file.txt
tail -f /var/log/syslog

The -f option is useful for monitoring logs as new entries are written.

14

grep — Search Text

grep "error" application.log
grep -i "error" application.log
grep -r "database" /var/www/

grep is one of the most useful Linux commands for searching logs and configuration files.

15

find — Find Files

find /home/user -name "report.txt"
find /var/log -name "*.log"
find /home -type f -size +100M
16

locate — Quickly Locate Files

locate report.txt

locate searches an indexed database of filenames.

17

wc — Count Lines, Words and Characters

wc -l file.txt
wc -w file.txt
wc -c file.txt
18

sort — Sort Text

sort names.txt
sort -n numbers.txt
19

uniq — Handle Duplicate Lines

sort names.txt | uniq
sort names.txt | uniq -c
20

cut — Extract Text

cut -d: -f1 /etc/passwd
21

echo — Display Text

echo "Hello Linux"
echo $HOME
echo "Linux is powerful" > notes.txt
echo "Another line" >> notes.txt
22

nano — Edit Text Files

nano notes.txt
23

man — Read Command Documentation

man ls
man chmod
man systemctl
24

history — View Previous Commands

history
history | grep docker
25

clear — Clear the Terminal

clear

You can also commonly use Ctrl + L.

26

whoami — Show Current User

whoami
27

id — Display User and Group Information

id
28

sudo — Run Commands With Elevated Privileges

sudo apt update

Use elevated privileges only when they are required.

29

chmod — Change File Permissions

chmod 755 script.sh
chmod +x script.sh
30

chown — Change File Ownership

sudo chown user:user file.txt
sudo chown -R user:user project/
31

ps — View Running Processes

ps
ps aux
ps aux | grep nginx
32

top — Monitor Processes

top

Useful for investigating CPU and memory consumption.

33

kill — Terminate a Process

kill 1234
kill -9 1234

Use forceful termination carefully because it doesn't allow the process to perform normal cleanup.

34

df — Check Disk Usage

df -h
35

du — Check File and Directory Size

du -sh /var/log
du -sh *

df shows filesystem capacity, while du helps identify what is consuming space.

36

free — Check Memory Usage

free -h
37

uname — Display System Information

uname -a
uname -r
38

hostname — Display the Hostname

hostname
39

uptime — Check System Uptime

uptime
40

ip — Manage Network Information

ip addr
ip route
ip link
41

ping — Test Network Connectivity

ping example.com
ping 8.8.8.8

A failed ping doesn't necessarily mean the destination is completely unreachable because ICMP may be blocked.

42

ss — Inspect Network Connections

ss -tuln
sudo ss -tulpn
43

curl — Transfer Data From a URL

curl https://example.com
curl -I https://example.com
curl https://api.example.com/data
44

wget — Download Files

wget https://example.com/file.zip
45

ssh — Connect to a Remote System

ssh username@192.168.1.100
ssh -i ~/.ssh/my-key username@server

SSH is fundamental for remote Linux administration and cloud-server management.

46

tar — Create and Extract Archives

tar -czf backup.tar.gz project/
tar -xzf backup.tar.gz
47

zip — Create ZIP Archives

zip -r project.zip project/
48

unzip — Extract ZIP Archives

unzip project.zip
unzip project.zip -d project/
49

apt — Manage Packages

sudo apt update
sudo apt upgrade
sudo apt install nginx
sudo apt remove nginx

The apt package manager is commonly used on Debian-based distributions such as Ubuntu and Debian.

50

systemctl and journalctl — Services and Logs

Modern Linux systems using systemd commonly use systemctl to manage services.

systemctl status nginx
sudo systemctl start nginx
sudo systemctl enable nginx

sudo journalctl -u nginx
sudo journalctl -u nginx -f

These commands are particularly useful for Linux administration and troubleshooting.

51

Using Linux Commands for Troubleshooting

The real power of Linux commands comes from combining them to investigate problems.

Find a high-CPU process

top
ps aux --sort=-%cpu | head

Find large files

find / -type f -size +1G 2>/dev/null

Search logs for errors

grep -i "error" application.log
tail -f application.log

Check listening ports

sudo ss -tulpn

Test HTTP connectivity

curl -I https://example.com
52

Combine Linux Commands With Pipes

A pipe sends the output of one command to another command. This is one of the most important concepts to understand when learning the Linux command line.

ps aux | grep nginx

ss -tuln | grep 443

history | grep docker

cat access.log | grep 404

Once you understand pipes, individual commands become building blocks for more powerful troubleshooting workflows.

53

Linux Output Redirection

Linux allows command output to be redirected to files.

ls -la > files.txt

echo "New entry" >> notes.txt

The > operator writes output to a file and can overwrite existing content. The >> operator appends output to the file.

54

How to Learn Linux Commands

Don't try to memorize all 50 commands at once. Practice them while completing real tasks.

  1. Learn navigation and file-management commands.
  2. Practice permissions and users.
  3. Learn process-management commands.
  4. Practice networking commands.
  5. Learn SSH and remote administration.
  6. Practice package and service management.
  7. Use commands together with pipes and redirection.
Recommended learning cycle
Learn → Practice → Break something safely → Troubleshoot → Document → Repeat
55

Frequently Asked Questions

What are the most important Linux commands for beginners?

Start with commands such as pwd, ls, cd, cp, mv, rm, grep, find, chmod, sudo, ps, df, ip, ping, ssh and apt.

Is Linux command line difficult to learn?

The basic commands are relatively straightforward. The more advanced skill is learning how commands work together and understanding Linux systems.

Which Linux commands are useful for troubleshooting?

Commands including top, ps, df, du, free, journalctl, systemctl, ip, ping, ss, curl, grep and tail are useful for troubleshooting.

Can I learn Linux without programming?

Yes. Linux administration does not require you to become a professional programmer. Basic shell scripting and Python can later help automate repetitive tasks.

Which Linux distribution should beginners use?

Mainstream distributions such as Ubuntu, Debian, Fedora and Linux Mint can all provide suitable environments for learning Linux. The best choice depends on your learning goals and required software.

References

Use official documentation when validating command syntax and distribution-specific behavior.

Was this guide helpful?
↑ Top