Getting Started With 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?
whoami
pwd
Move around the folders
ls -la
cd /var/www/html
clear
cd ~
Check your system
lsb_release -a
uname -r
free -h
df -h
Install and Update Packages
Refresh the package list
sudo apt update
Upgrade what is already installed
sudo apt upgrade -y
Install a package
sudo apt install -y nginx
sudo apt install -y htop vim git
Remove a package
sudo apt remove --purge nginx
sudo apt autoremove --clean
Users and Permissions
Create a user
sudo adduser deployer
sudo usermod -aG sudo deployer
Delete a user
sudo deluser --remove-home deployer
sudo userdel deployer
Set a password
sudo passwd deployer
Everyday Commands
Look at a file
cat /etc/os-release
less /var/log/syslog
head -n 5 /etc/hosts
tail -n 20 /var/log/syslog
Make, copy, move, delete
mkdir projects
cp -r projects ~/backup
mv projects ~/active
rm -rf ~/active/projects
Edit a file
nano /etc/motd
Networking Basics
Connect to a server
ssh -i ~/.ssh/id_rsa -p 22 [email protected]
ssh -i ~/.ssh/id_rsa -p 22 [email protected]
Run commands over SSH
ssh [email protected] "uptime"
ssh [email protected] "whoami; hostname"
Check what is listening
ss -tulnp
sudo ss -tuln | grep :80
System Maintenance
Service control
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl status nginx
Enable on boot
sudo systemctl enable --now nginx
sudo systemctl disable nginx
View logs
sudo journalctl -u nginx -f
sudo journalctl -p err -u nginx
Cleanup and Safety
Clear old kernels
sudo apt autoremove --clean
Free disk space
sudo journalctl --vacuum-time=7d
sudo du -sh /var/log/* | sort -rh | head
Never skip the check
sudo apt list --upgradable
sudo apt show nginx
Questions for the Community
What is your first command after logging in?
How do you keep sudo safe?
What is your practice target?
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!