← BACK TO FORUM INDEX

Getting Started With Ubuntu

BY | Dec 2, 2026 | Ubuntu

Getting Started With Ubuntu — Basic Commands for New Users

Ubuntu is the friendliest door into Linux. Most of what you will ever need is a handful of commands, and almost all of them are safe to type. This post is a starter kit: the basics first, then the everyday commands you will reach for again and again.

Everything below runs in a terminal. If you are on a desktop, open the terminal app (Ctrl+Alt+T). If you are on a server, connect with SSH. The isolated lab environment here is the right place to practice — never run these on a machine you do not own.

First Things First

Who am I, and where am I?

These two commands are your starting point. They tell you your user and the folder you are standing in.
whoami
pwd

Move around the folders

Navigate with ls to list, cd to change folders, and clear to wipe the screen. cd ~ returns you to your home folder.
ls -la
cd /var/www/html
clear
cd ~

Check your system

Know what you are running before you change anything. Ubuntu version, kernel, memory, disk — all in one go.
lsb_release -a
uname -r
free -h
df -h

Install and Update Packages

Refresh the package list

Always run this first so you install the newest versions available in the repositories.
sudo apt update

Upgrade what is already installed

Keeps your system patched. Review the list before rebooting.
sudo apt upgrade -y

Install a package

Ask for confirmation with -y. This installs a single package and its dependencies.
sudo apt install -y nginx
sudo apt install -y htop vim git

Remove a package

Purge removes the package and its leftover config files. Use --purge only when you are sure.
sudo apt remove --purge nginx
sudo apt autoremove --clean

Users and Permissions

Create a user

Use -m to make a home folder and -s to give a starting shell. Add to a group with -G.
sudo adduser deployer
sudo usermod -aG sudo deployer

Delete a user

The -r flag removes the home folder too. Only do this on users you no longer need.
sudo deluser --remove-home deployer
sudo userdel deployer

Set a password

The - means read the password from the terminal without echoing it. Lock an account with sudo usermod -L.
sudo passwd deployer

Everyday Commands

Look at a file

Read with cat, page through with less, or peek at the top lines with head and tail.
cat /etc/os-release
less /var/log/syslog
head -n 5 /etc/hosts
tail -n 20 /var/log/syslog

Make, copy, move, delete

The four verbs you will use constantly. cp -r copies folders, mv moves or renames, rm -r deletes.
mkdir projects
cp -r projects ~/backup
mv projects ~/active
rm -rf ~/active/projects

Edit a file

Nano is the beginner-friendly editor. Save with Ctrl+O, exit with Ctrl+X.
nano /etc/motd

Networking Basics

Connect to a server

Replace user@host and the port. -i keeps you logged in after the session ends.
ssh -i ~/.ssh/id_rsa -p 22 [email protected]
ssh -i ~/.ssh/id_rsa -p 22 [email protected]

Run commands over SSH

Pipe a command into a session to run something without a login shell.
ssh [email protected] "uptime"
ssh [email protected] "whoami; hostname"

Check what is listening

See open ports and what is bound to them. -l shows the process names.
ss -tulnp
sudo ss -tuln | grep :80

System Maintenance

Service control

Start, stop, and restart services. Check status with -status.
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl status nginx

Enable on boot

A service must be enabled to survive a reboot. Do this after confirming it works.
sudo systemctl enable --now nginx
sudo systemctl disable nginx

View logs

Follow a service log live with -f. Journal is the modern log hub.
sudo journalctl -u nginx -f
sudo journalctl -p err -u nginx

Cleanup and Safety

Clear old kernels

After upgrading the kernel, old ones pile up. Remove the unused ones to reclaim disk.
sudo apt autoremove --clean

Free disk space

Journal logs grow large. Trim the old ones — keep the most recent entries.
sudo journalctl --vacuum-time=7d
sudo du -sh /var/log/* | sort -rh | head

Never skip the check

Before any destructive command, list first. apt will show what will be removed; confirm before you run it.
sudo apt list --upgradable
sudo apt show nginx

Questions for the Community

What is your first command after logging in?

Whoami and pwd, or something else? What surprised you most?

How do you keep sudo safe?

Do you set sudo to always ask for your password, or log every command?

What is your practice target?

A disposable lab VM, a container, or a throwaway cloud instance? What did you break?

Start with whoami, pwd, apt update, and apt install. Keep a disposable lab machine for practice, list before you delete, and lean on sudo apt autoremove --clean to stay tidy. Ubuntu is forgiving — the terminal will not break your day unless you tell it to.

Disclaimer

This content is for educational and informational purposes only. It is not technical advice. Always practice on a machine you own or control, back up data before destructive commands, and verify the exact command syntax against your Ubuntu release. Never run rm -rf or package removals on production systems without a tested backup and a clear read of what will be affected.

DISCUSSION

No replies yet. Be the first to join the discussion!

A1 AI Assistant
Call Text A1 Forum Tech News Contact Form
Cookie Settings