Your First Week on a Linux Server — 35+ Essential Commands
Keywords: Quick Reference Before We Start
Before we start, here are the terms you’ll see throughout this guide. You don’t need to memorize these — just know they exist, and the context will make them click.
| Term | What It Means |
|---|---|
| Terminal 💻 | The text-based interface where you type commands |
| Shell 🐚 | The program (usually Bash) that interprets your commands |
| Bash ⚙️ | The most common shell; the “language” your terminal speaks |
| Sudo 🔑 | A command that lets you run other commands with admin privileges |
| Package manager 📦 | A tool (like apt) that installs and updates software for you |
| Daemon / Service 👻 | A background program that runs continuously (like a web server) |
| Permissions 🔒 | Rules that control who can read, write, or execute a file |
| Root 👑 | The all-powerful system administrator account |
With those terms in your back pocket, you’re ready. Let’s start.
Introduction: Starting the Server Journey
You’ve just connected to your new server. Maybe you provisioned it from a provider like AlexHost, which offers instant Ubuntu deployment with a single click. You open your terminal, type: ssh root@your-server-ip , and hit Enter. The screen clears. A blinking cursor stares back at you from a line that reads something like root@vps:~#
Now what?

The terminal isn’t a relic. It’s the most direct, composable, and reliable way to tell a computer what to do. There’s no graphical overhead, no menus to navigate, no waiting for a UI to load. You type a command, something happens, and you chain the next command to it. Over SSH, it works identically whether your server is in the next room or across the ocean.
This article won’t hand you a memorization list. Instead, you’re going to live through a realistic 7-day journey on a fresh Linux VPS — the same progression you’d follow if you actually sat down with a new server today. By the end, you won’t just know the commands. You’ll know when to reach for each one.
Day 1: Getting Connected & Exploring
You’ve just connected to your server. The terminal shows something like root@vps:~#. You’re logged in — but where are you? What’s here? Let’s find out.

Step 1: Connect with “ssh”
Everything starts with ssh — Secure Shell. It’s the gateway command that takes you from your local machine to the remote server.
ssh username@server-ipOn most VPS providers, you’ll use the IP address from your hosting dashboard and the username they assign you (often root or ubuntu). If this is your first time connecting, you’ll be asked to confirm the server’s fingerprint — type yes and press Enter.
✅ You’re now connected to your server.
Step 2: Confirm your identity with “whoami”
Before doing anything, verify which user you’re logged in as.
whoamiIf you see root, you’re operating as the all-powerful administrator. That’s common on a fresh VPS, but it also means every command you type has full system access — so pay attention.
✅ You know who you are on this system.
Step 3: Find your location with: “pwd”
The command pwd — Print Working Directory — tells you exactly where you are in the filesystem.
pwd✅ You know where you are.
Step 4: See what’s present with “ls”
Now let’s look around the server. The ls command lists files and directories in your current location.
lsls -latotal 28 drwx------ 4 root root 4096 Apr 10 12:00 . drwxr-xr-x 18 root root 4096 Apr 10 12:00 .. -rw------- 1 root root 532 Apr 10 12:01 .bash_history -rw-r--r-- 1 root root 3106 Apr 10 12:00 .bashrc -rw-r--r-- 1 root root 161 Apr 10 12:00 .profile
The -l flag gives you the long format (permissions, owner, size, date), and -a shows all files including hidden ones. You’ll use ls -la constantly.
✅ You can see everything in your current directory.
Step 5: Move around with “cd”
The cd command — Change Directory — is how you navigate the filesystem.
cd /var/log
#Check new dir location
pwd
/var/logThree variations you’ll use constantly:
cd .. # Go up one directory level cd ~ # Go back to your home directory cd - # Go back to the previous directory you were in
The “cd -“ trick is especially useful — it’s like an “undo” for your last directory change.
✅ You can move anywhere on the filesystem.
Step 6: Clean up with “clear”
After running several commands, your terminal gets cluttered. The clear command wipes the screen and gives you a fresh start.
clear✅ Your terminal is clean and ready for the next command.
Step 7: Look things up with “man”
You don’t need to memorize every flag for every command. The man command — Manual — opens the built-in documentation for any command.
man lsThink of man as your safety net. When you’re unsure what a command does or what options it supports, man has the answer.
✅ You have access to built-in documentation for every command.
Step 8: Review your past with “history”
The history command shows every command you’ve typed in this session.
history 1 whoami
2 pwd
3 ls -la
4 cd /var/log
5 clear
6 historyHere’s the useful part: you can re-run any command by typing “!” followed by its number.
!3✅ You can review and re-run any previous command.
Day 2: Creating & Managing Your Workspace

Step 1: Create directories with “mkdir”
The mkdir command — Make Directory — creates new folders.
mkdir projects
# Check dir
ls
projectsBut the real star is mkdir -p, which creates nested directories in one shot — including any parent directories that don’t exist yet.
mkdir -p projects/myapp/logsWithout -p, you’d need to create projects, then projects/myapp, then projects/myapp/logs separately. With it, one command does everything.
✅ You’ve created a directory structure for your project.
Step 2: Create empty files with “touch”
The touch command creates an empty file instantly.
touch projects/myapp/notes.txt
ls projects/myapp/
# logs notes.txtIf the file already exists, touch updates its timestamp instead. It’s a quick way to create placeholder files or mark that you’ve worked on something.
✅ You’ve created your first file on the server.
Step 3: Copy files with “cp”
The cp command — Copy — duplicates files and directories.
cp projects/myapp/notes.txt projects/myapp/notes-backup.txtFor directories, you need the -r flag (recursive), which copies everything inside the directory too:
cp -r projects/myapp projects/myapp-backup✅ You can duplicate files and entire directory trees.
Step 4: Move or rename files with “mv”
The mv command does two jobs: it moves files and renames them. Same command, different context.
mv projects/myapp/notes.txt projects/myapp/readme.txtThis renames notes.txt to readme.txt in the same directory. To actually move a file to a different location:
mv projects/myapp/readme.txt projects/✅ You can move and rename files with one command.
Step 5: Delete files with “rm”
The rm command — Remove — deletes files permanently.
rm projects/myapp-backup/readme.txtFor directories, use -r (recursive):
rm -r projects/myapp-backup⚠️ WARNING: rm -rf is the nuclear option. The -f flag forces deletion without asking for confirmation, and combined with -r, it will delete entire directory trees silently. There is no undo. Double-check the path before pressing Enter. Never run rm -rf / — it will attempt to delete your entire filesystem.
✅ You can remove files and directories you no longer need.
Step 6: Print and write text with “echo”
The echo command prints text to the terminal — but its real power comes when combined with redirection operators.
echo "Hello, server"Hello, server
Now redirect that output into a file using “>” (overwrite) or “>>” (append):
echo "Server setup started" > projects/myapp/notes.txtecho "Added a log entry" >> projects/myapp/notes.txtThe > operator creates the file or overwrites it if it exists. The >> operator appends to the end without touching existing content. This is your first taste of redirection — one of Linux’s core superpowers.
✅ You can write text to files directly from the command line.
Step 7: Read files with “cat”
The cat command — Concatenate — displays file contents in the terminal.
cat projects/myapp/notes.txtServer setup started Added a log entry
For small files, cat is the fastest way to inspect contents. For larger files, you’ll want less (which lets you scroll), but cat is your go-to for quick checks.
✅ You can read file contents without opening an editor.
Step 8: Edit files with “nano”
When you need to actually modify a file, nano is the most beginner-friendly terminal editor.
nano projects/myapp/notes.txtNano opens the file in your terminal with a simple interface. The keyboard shortcuts are displayed at the bottom of the screen.
💡 TIP: Nano’s essential shortcuts: Ctrl+O to save (then Enter to confirm), Ctrl+X to exit, Ctrl+W to search for text. That’s all you need to start editing.
You’ll also hear about vim — it’s more powerful but has a notoriously steep learning curve. Stick with nano for now. You can explore vim later when you’re comfortable with the terminal.
✅ You can edit files directly on the server.
Day 3: Finding What You Need

Step 1: Search for files with “find”
The find command searches for files by name, type, size, and more.
find /home -name "*.txt"/home/user/projects/myapp/notes.txt /home/user/documents/report.txt
This searches everything under /home for files ending in .txt. You can search by type too — find / -type f -name “config” finds all files named “config” across the entire system.
find is thorough but can be slow on large filesystems. For everyday searches, it’s your most reliable tool.
✅ You can locate any file on the system by name or type.
Step 2: Search inside files with “grep”
If find locates files, grep locates content inside them. It’s the command-line detective.
grep "error" /var/log/syslogApr 10 12:15:03 server kernel: [error] disk I/O timeout Apr 10 12:18:22 server nginx: [error] connection refused
Here’s where grep becomes even more powerful — combine it with other commands using the pipe “|” operator. The pipe takes the output of one command and feeds it as input to the next.
cat /var/log/syslog | grep "error"This does the same thing as the previous example, but the pipe pattern lets you chain commands together. You’ll use pipes constantly once they click. For example, to search for errors in today’s log entries:
cat /var/log/syslog | grep "Apr 15" | grep "error"Each pipe narrows the results further. This composability is what makes the Linux command line so powerful.
✅ You can search for any text pattern across any file.
Step 3: Find executable locations with “which”
The which command tells you where a command’s executable file lives on the system.
which python3/usr/bin/python3
This is useful when you need to know which version of a program you’re running, or when a script needs the full path to an executable.
✅ You know exactly where any command’s executable is stored.
Step 4: Find more with “whereis”
The whereis command goes further than which — it finds the binary, the source code (if installed), and the manual page.
whereis python3python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/share/man/man1/python3.1.gz
Where which gives you one path, whereis gives you the full picture. Use which when you just need the executable. Use whereis when you want to see everything related to a command.
✅ You can locate every component of a command on the system.
Step 5: Get a quick description with “whatis”
The whatis command gives you a one-line description of any command.
whatis grepgrep (1) - print lines that match patterns
It’s the fastest way to remind yourself what a command does without opening the full man page. Think of it as a quick gloss lookup.
✅ You can get a one-line summary of any command’s purpose.
Day 4: Understanding Your Machine

Step 1: Check system info with “uname”
The uname command — Unix Name — displays system information.
uname -aLinux vps 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux
The -a flag shows everything: the kernel name, hostname, kernel version, architecture, and operating system. On a VPS, this tells you exactly what kernel you’re running and whether you’re on a 64-bit system (you almost certainly are).
✅ You know your kernel version and system architecture.
Step 2: Check disk space with “df”
The df command — Disk Free — shows how much storage you have and how much is used.
df -hFilesystem Size Used Avail Use% Mounted on /dev/sda1 50G 3.2G 44G 7% / tmpfs 2.0G 0 2.0G 0% /dev/shm
The -h flag stands for “human-readable” — it displays sizes in GB and MB instead of raw bytes. Pay attention to the “/” root partition line. At 7% used, this server has plenty of room. If you ever see that number climbing past 80%, it’s time to clean up.
✅ You know exactly how much disk space is available.
Step 3: Check memory with “free”
The free command shows your RAM usage.
free -htotal used free shared buff/cache available Mem: 3.9Gi 412Mi 2.8Gi 12Mi 680Mi 3.3Gi Swap: 1.0Gi 0B 1.0Gi
Again, -h gives you human-readable output. The key column here is “available” — this is the memory actually free for new applications. “Used” includes memory the kernel is using for caching, which can be freed if needed. On a fresh VPS with 4GB of RAM, seeing 3.3GB available is exactly what you want.
✅ You know how much memory your server has and how much is free.
Step 4: Monitor processes with “top”
The top command shows real-time process monitoring — a live view of what’s running and what resources each process is consuming.
toptop - 14:32:01 up 2 days, 3:15, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 89 total, 1 running, 88 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.0 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si
MiB Mem : 3948.0 total, 2876.4 free, 412.1 used, 659.5 buff/cache
MiB Swap: 1024.0 total, 1024.0 free, 0.0 used. 3389.2 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 168864 11776 8320 S 0.0 0.3 0:02.15 systemd
234 root 20 0 13420 5632 4864 S 0.0 0.1 0:00.42 sshd
567 root 20 0 10384 4096 3584 S 0.0 0.1 0:00.08 toptop updates every few seconds. The most important columns are PID (process ID), %CPU, %MEM, and COMMAND. If your server ever feels slow, top is the first place to look.
💡 TIP: Press q to quit top. If top is running and you don’t know how to stop, this is the answer.
✅ You can monitor running processes in real time.
Step 5: Snapshot processes with “ps”
The ps command — Process Status — gives you a static snapshot of running processes.
ps auxUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.3 168864 11776 ? Ss Apr10 0:02 /sbin/init root 234 0.0 0.1 13420 5632 ? Ss Apr10 0:00 /usr/sbin/sshd root 567 0.0 0.1 10384 4096 pts/0 R+ 14:32 0:00 ps aux
The aux flags show all processes from all users with detailed information. The key columns: USER (who owns the process), PID (the process ID you’d use with kill), %CPU and %MEM (resource usage), and COMMAND (what’s running). Use ps when you need a quick snapshot rather than a live view.
✅ You can take a snapshot of every running process.
Step 6: Check the calendar with “cal”
The cal command displays a simple calendar.
cal April 2026
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30It’s not essential, but it’s a nice reminder that the terminal can do more than just manage servers. It’s also a quick way to check the date without leaving your session.
✅ You can display a calendar right in your terminal.
Step 7: Check the date with “date”
The date command shows the current system date and time.
dateWed Apr 15 14:32:01 UTC 2026
This matters more than you’d think. Many services — especially SSL certificates, log rotation, and scheduled tasks — depend on accurate system time. If the date looks wrong, you’ll want to fix it before installing anything.
✅ You know your server’s current date and time.
Day 5: Installing & Running Services

Step 1: Update package lists with “apt update”
Before installing anything, refresh your package repository lists.
sudo apt updateHit:1 http://archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB] Get:3 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Fetched 257 kB in 2s (134 kB/s) Reading package lists... Done Building dependency tree... Done
Important distinction: apt update refreshes the list of available packages — it does not install anything. apt upgrade actually downloads and installs newer versions of packages you already have. They almost always go together:
sudo apt update && sudo apt upgrade -yOn Red Hat-based systems like CentOS or Fedora, the equivalent commands are yum update or dnf update.
✅ Your package list is up to date and ready for installations.
Step 2: Install software with “apt install”
Now let’s install something. Nginx is a popular web server — a good first service to set up.
sudo apt install nginx -yReading package lists... Done Building dependency tree... Done The following NEW packages will be installed: nginx nginx-common nginx-core 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 582 kB of archives. Setting up nginx (1.18.0-6ubuntu14.4) ...
This is where your server starts doing something real. The -y flag automatically confirms the installation so you don’t have to type yes. Nginx will install and typically start running immediately.
✅ You’ve installed your first service on the server.
Step 3: Manage services with “systemctl”
The systemctl command — System Control — is how you start, stop, and manage services.
systemctl status nginx● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2026-04-15 14:35:00 UTC; 2min ago
Main PID: 1234 (nginx)
Tasks: 2 (limit: 4915)
Memory: 3.2M
CGroup: /system.slice/nginx.serviceThe key line is Active: active (running) — that means Nginx is up and working. Three systemctl commands you’ll use constantly:
sudo systemctl start nginx # Start the service now
sudo systemctl stop nginx # Stop the service
sudo systemctl enable nginx # Start automatically on every bootThe enable command is the one beginners miss. start runs the service right now. enable ensures it starts every time the server reboots. For a web server, you almost always want both.
✅ You can control any service on your server.
Step 4: Stop processes with “kill”
Sometimes you need to terminate a process manually. The kill command does this by PID.
kill 1234This sends a termination signal to process 1234, asking it to shut down gracefully. If it doesn’t respond, you can force it:
kill -9 1234⚠️ WARNING: kill -9 is a force kill. It doesn’t let the process clean up — no saving state, no closing connections properly. Use it only when a normal kill doesn’t work.
Find the PID using ps aux or top, then kill it.
✅ You can terminate any process by its ID.
Step 5: Kill by name with “pkill”
Finding the PID first is sometimes unnecessary. The pkill command kills processes by name.
pkill nginxThis finds all processes matching “nginx” and terminates them. It’s faster than looking up the PID with ps and then running kill. Use pkill when you know the process name and want a quick termination.
✅ You can kill processes without knowing their PID.
Step 6: Download files with “wget”
The wget command — Web Get — downloads files from the internet.
wget https://example.com/file.zip--2026-04-15 14:40:00-- https://example.com/file.zip Resolving example.com (example.com)... 93.184.216.34 Connecting to example.com (example.com)|93.184.216.34|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1048576 (1.0M) [application/zip] Saving to: 'file.zip' file.zip 100%[===================>] 1.00M 2.34MB/s in 0.4s 2026-04-15 14:40:01 (2.34 MB/s) - 'file.zip' saved [1048576/1048576]
wget is straightforward: give it a URL, it downloads the file to your current directory. It also supports resuming interrupted downloads with wget -c.
✅ You can download files directly to your server.
Step 7: Transfer data with “curl”
The curl command — Client URL — is more versatile than wget. It handles downloads, API requests, and data transfers with custom headers.
curl -O https://example.com/file.zipThe -O flag saves the file with its original name (just like wget). But curl can do much more:
curl -s https://api.example.com/dataThe -s flag runs silently, making curl perfect for scripting and API calls. While wget is great for simple downloads, curl is the tool you’ll reach for when you need to interact with web services, test APIs, or send custom HTTP headers.
✅ You can transfer data from any URL — files, APIs, and more.
Day 6: Locking Things Down

📝 NOTE: Your user needs sudo permissions for these commands to work. On most VPS providers, the default user is already set up with sudo access. If you created a new user, you’ll need to add them to the sudo group first.
Step 1: Run commands safely with “sudo”
The sudo command — Superuser Do — lets you run commands with elevated privileges.
sudo apt updateYou’ll be prompted for your password the first time you use sudo in a session. After that, it remembers for a few minutes. The reason sudo exists is simple: running as root all the time is dangerous. A single typo with root privileges can wipe your system. sudo forces you to consciously escalate privileges for each command — it’s a safety mechanism, not just a privilege escalator.
✅ You can run admin commands without logging in as root.
Step 2: Change file permissions with “chmod”
The chmod command — Change Mode — controls who can read, write, or execute a file.
chmod 755 script.shThe numbers represent permissions for three groups: owner, group, and everyone else. Each digit is a sum of read (4), write (2), and execute (1):
- 755 means: owner can do everything (4+2+1=7), group can read and execute (4+1=5), everyone else can read and execute (4+1=5). This is standard for scripts and directories.
- 644 means: owner can read and write (4+2=6), group can read (4), everyone else can read (4). This is standard for configuration files and documents.
chmod 644 config.txtIf a script won’t run, it’s almost always a permissions issue. chmod +x script.sh is a quick way to make any file executable without remembering the numbers.
✅ You control exactly who can access each file.
Step 3: Change file ownership with “chown”
The chown command — Change Owner — sets who owns a file.
sudo chown www-data:www-data /var/www/html/index.htmlThis changes the owner to www-data and the group to www-data. It’s commonly used when setting up web servers — the web server process needs to own the files it serves. The format is user:group, and you’ll almost always need sudo to change ownership.
✅ You can assign file ownership to any user or group.
Step 4: Change passwords with “passwd”
The passwd command updates user passwords.
passwd usernameNew password: Retype new password: passwd: password updated successfully
On a fresh VPS, changing the default password should be one of your first actions. If you’re logged in as the user whose password you want to change, just run passwd without a username.
✅ You can update passwords for any user on the system.
Step 5: Create new users with “useradd”
The useradd command creates a new user account.
sudo useradd -m newuserThe -m flag is critical — it creates a home directory at /home/newuser. Without it, the user exists but has no home directory, which causes problems with SSH and various applications. After creating the user, set their password:
sudo passwd newuser✅ You can create new user accounts with home directories.
Step 6: Switch users with “su”
The su command — Switch User — lets you log in as another user.
su - newuserwhoami newuser
The “-“ flag (or –login) is important — it loads the new user’s environment, including their path and shell configuration. Without it, you’d switch users but keep the old user’s environment, which leads to confusing behavior.
✅ You can switch between user accounts on the server.
Step 7: Set up the firewall with “ufw”
The ufw command — Uncomplicated Firewall — is the simplest way to manage your server’s firewall on Ubuntu.
First, set the default policy to deny all incoming connections:
sudo ufw default deny incomingsudo ufw allow 22/tcp⚠️ CRITICAL WARNING: Always run sudo ufw allow 22/tcp before sudo ufw enable. If you enable the firewall without allowing SSH, you’ll lock yourself out of the server. Your only option would be to access the server through your hosting provider’s console — which may not be available on all plans.
Now it’s safe to enable the firewall:
sudo ufw enableCommand may disrupt existing SSH connections. Proceed with operation (y|n)? y Firewall is active and enabled on system startup
You can check the status at any time:
sudo ufw statusStatus: active To Action From -- ------ ---- 22/tcp ALLOW Anywhere
Your server now only accepts incoming SSH connections on port 22. Everything else is blocked. When you install Nginx later, you’ll add another rule: sudo ufw allow 80/tcp for HTTP and sudo ufw allow 443/tcp for HTTPS.
✅ Your server is protected by a firewall.
Day 7: Network Checks & Wrapping Up

Your server is set up, secured, and running. Before you call it done, let’s verify everything works from the outside and learn how to shut down properly.
Step 1: Test connectivity with “ping”
The ping command tests whether your server can reach other machines on the network.
ping -c 4 8.8.8.8PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=12.3 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=11.8 ms 64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=12.1 ms 64 bytes from 8.8.8.8: icmp_seq=4 ttl=118 time=12.5 ms --- 8.8.8.8 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 11.800/12.175/12.500/0.274 ms
The -c 4 flag limits the ping to 4 packets. Without it, ping runs forever until you press Ctrl+C. The statistics at the end tell you everything: 4 packets sent, 4 received, 0% loss. Your server’s network is working.
✅ You’ve confirmed your server has working network connectivity.
Step 2: Check network interfaces with “ip”
The ip command shows your server’s network configuration.
ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
inet 203.0.113.50/24 brd 203.0.113.255 scope global eth0The ip command replaces the deprecated ifconfig. The output shows your loopback interface (lo, always 127.0.0.1) and your main network interface (eth0 in this case). The inet line shows your server’s IP address — this is the address you’d use to SSH in or access your web server.
✅ You can see your server’s IP addresses and network interfaces.
Step 3: Create file links with “ln”
The ln command creates links between files — essentially shortcuts.
ln -s /var/www/html /home/user/webrootThis creates a symbolic link at /home/user/webroot that points to /var/www/html. When you access the link, you’re actually accessing the target directory. Symbolic links are useful for creating convenient access paths without duplicating files.
✅ You can create shortcuts to files and directories anywhere on the system.
Step 4: Shut down safely with “shutdown”
The shutdown command powers down your server in a controlled way.
sudo shutdown -h nowThe -h flag means “halt” — stop everything and power off. now means immediately. But you can also schedule a shutdown:
sudo shutdown -h +5This gives you 5 minutes before shutdown — enough time to save work, notify users, or change your mind. To cancel a scheduled shutdown:
sudo shutdown -cThe -c flag cancels any pending shutdown. It’s a small safety net that can save you from an accidental power-off.
✅ You can shut down the server safely, immediately or on a schedule.
Step 5: Restart with “reboot”
The reboot command restarts your server.
sudo rebootThis is equivalent to shutdown -r now — the -r flag means “restart” instead of “halt.” You’ll use this after kernel updates or configuration changes that require a fresh start.
✅ You can restart the server with a single command.
What’s Next
Seven days ago, you were staring at a blank terminal after SSH-ing into a server you didn’t know how to use. Now you can navigate the filesystem, create and manage files, search for anything on the system, check your server’s health, install software, run services, lock down security, and manage the server’s lifecycle from startup to shutdown.
The real skill isn’t memorizing these commands. It’s knowing which one to reach for when a problem appears. That comes from using them — not from reading about them.
Open a terminal today. Run ls, cd, and pwd until they feel natural. Add one new command per day. Within a week, the terminal won’t feel like a foreign interface anymore. It’ll feel like the direct line to your server that it is.
If you’re ready to put these commands to work on your own server, AlexHost offers affordable Linux VPS plans with instant setup and 24/7 support — a great place to practice without risk.
Cheatsheet: All Commands at a Glance
Here’s every command from this guide in one place. Bookmark this page.
| Command | Stands For | What It Does |
|---|---|---|
ssh | Secure Shell | Connect to a remote server securely |
whoami | Who Am I | Show current username |
pwd | Print Working Directory | Show current directory path |
ls | List | List files and directories |
cd | Change Directory | Navigate between directories |
clear | Clear | Clear the terminal screen |
man | Manual | Open the manual page for any command |
history | History | Show previously executed commands |
mkdir | Make Directory | Create new directories |
touch | Touch | Create empty files or update timestamps |
cp | Copy | Copy files and directories |
mv | Move | Move or rename files and directories |
rm | Remove | Delete files and directories |
echo | Echo | Print text or write to files |
cat | Concatenate | Display file contents |
nano | Nano | Terminal-based text editor |
find | Find | Search for files by name, type, or attributes |
grep | Global Regular Expression Print | Search for text patterns in files |
which | Which | Locate a command’s executable path |
whereis | Where Is | Locate binary, source, and manual for a command |
whatis | What Is | Get a one-line description of a command |
uname | Unix Name | Display system information |
df | Disk Free | Show disk space usage |
free | Free | Show memory/RAM usage |
top | Top | Real-time process monitoring |
ps | Process Status | Snapshot of running processes |
cal | Calendar | Display a calendar |
date | Date | Show or set system date and time |
apt update | APT Update | Refresh package repository lists |
apt install | APT Install | Install software packages |
systemctl | System Control | Start, stop, and manage services |
kill | Kill | Terminate a process by PID |
pkill | Process Kill | Terminate processes by name |
wget | Web Get | Download files from the internet |
curl | Client URL | Transfer data from URLs |
sudo | Superuser Do | Run commands with elevated privileges |
chmod | Change Mode | Change file permissions |
chown | Change Owner | Change file ownership |
passwd | Password | Change user passwords |
useradd | User Add | Create a new user account |
su | Switch User | Switch to another user |
ufw | Uncomplicated Firewall | Manage the server firewall |
ping | Ping | Test network connectivity |
ip | IP | Show network interfaces and addresses |
ln | Link | Create file links (symbolic or hard) |
shutdown | Shutdown | Safely power down the server |
reboot | Reboot | Restart the server |
