Lazo Lab Sign up

Guides

Linux command line

Beginner 路 8 min read

The commands that let you run any server, from moving around to managing services.

Why Linux?

Most of the internet runs on Linux: web servers, cloud machines, routers, Android phones. Security tools are built for it, and nearly every server you'll touch is managed by typing commands.

Getting around

pwd               # where am I?
ls -la            # what's here, including hidden files
cd /var/log       # go somewhere
cd ~              # go home
mkdir projects    # make a folder

Working with files

cat notes.txt         # print a file
less big.log          # scroll a big file (q to quit)
tail -f access.log    # watch a log live
cp a.txt b.txt        # copy
mv old.txt new.txt    # move or rename
rm file.txt           # delete (no recycle bin!)
grep -r "error" .     # search inside files

Running the system

sudo apt update && sudo apt upgrade   # install updates
sudo systemctl status nginx           # is a service running?
journalctl -u nginx -f                # its live log
htop                                  # what's using CPU and memory
lsblk                                 # list drives
df -h                                 # free space

sudo means care

sudo runs a command as the all-powerful root user. It's how you change the system, and how you break it. Read every sudo command before pressing Enter, especially anything with rm, wipefs or mkfs.