Master Ubuntu: A Quick-Start Guide for Beginners
Welcome to Skillspresso! In this guide, we’re going to help you master the basics of Ubuntu, one of the most popular Linux distributions.
Whether you're completely new to Linux or just looking to sharpen your skills, this guide will walk you through essential commands and tools to get up and running with Ubuntu quickly and confidently.
Why Ubuntu?
Ubuntu is widely praised for its user-friendliness, vast support community, and flexibility.
It’s used by developers, sysadmins, and casual users alike for everything from coding to hosting websites.
However, for beginners, Ubuntu can seem a little intimidating.
Fear not—this guide is here to help you overcome the initial learning curve!
Choose the right OS version
In Ubuntu you have two different types of versions.
The "latest Version", which normally only has security updates and support for a maximum of 9 Months.
Or you can choose the LTS version, which stands for "Long Term Support", this version gives you security updates for up to 5 years.
The latest LTS version (24.04. LTS) gets security updates until 25th of April, 2029, according to https://endoflife.date/ubuntu.
The LTS version, is what I use with all of my ubuntu systems and what I recommend for production systems.
Getting to Know the Terminal
The terminal is at the heart of Ubuntu. While the graphical interface is powerful, learning to use the terminal can give you far more control and flexibility.
Here are a few basic terminal commands to get you started:
Command | Description |
---|---|
pwd | Print working directory – shows your current directory. |
ls | List files and directories in your current location. |
cd | Change directory – use it to navigate to other folders. |
mkdir | Make directory – creates a new folder. |
rm | Remove a file (use rm -r for directories). |
cp | Copy files from one location to another. |
mv | Move (or rename) a file or folder. |
cat | Display the contents of a file. |
nano | Open the Nano text editor to modify files. |
sudo | Run a command with administrative (root) privileges. |
Using sudo Safely
sudo
stands for "superuser do," and it allows you to run commands as an administrator (root user).
Many critical system tasks require sudo
because they involve changing system files or installing/removing software.
When you run a command with sudo
, you’re essentially telling the system: "I know what I’m doing, let me proceed."
How to Use sudo
To use sudo
, just add it before the command you want to run.
For example, if you want to update your system packages, you would run:
sudo apt update
Best Practices for Using sudo
- Be careful: Since
sudo
allows you to make changes at the system level, mistakes can cause significant issues. Only usesudo
when necessary. - Check what you're running: Before pressing enter, make sure the command is typed correctly. A single typo could lead to unwanted changes or data loss.
- Use it sparingly: Not all tasks need
sudo
. Use it only when the system prompts you or when you know the task requires administrative access (like installing software).
Managing Files and Directories
In Ubuntu, most of the action happens in the home directory (your personal workspace). Let’s look at a few common tasks.
Listing Files
To list files in your current directory, use:
ls
You can add options to ls
for more detailed output.
For example:
ls -l
This lists files with additional details like permissions, owner, and file size.
Navigating Directories
Use cd
to change directories. For example, if you want to move to the Documents folder:
cd Documents
To move back to your home directory, simply type:
cd ~
Creating and Removing Files or Directories
To create a new folder / directory:
mkdir my_folder
To remove a file:
rm myfile.txt
Editing Files
You can use the Nano editor to modify files. For example:
nano myfile.txt
After making your changes, press CTRL + X, then Y to save.
Installing and Managing Software
Ubuntu makes it easy to install new software through apt and snap, two package management systems.
Using apt
(Advanced Package Tool)
Apt is the traditional way to install software on Ubuntu.
To update your system and make sure all software packages are up-to-date, run:
sudo apt update
sudo apt upgrade
To install new software, such as Git, use:
sudo apt install git
If you no longer need a program, uninstall it using:
sudo apt remove package_name
Using snap
Snap is another package manager that’s great for installing newer applications.
To install a snap package, such as Spotify, run:
sudo snap install spotify
Snap packages are isolated, so they won’t interfere with system files, making them perfect for casual use.
Securing Your Ubuntu System
Security is crucial, and Ubuntu comes with several built-in features to help keep your system safe.
Keeping Your System Updated
Make sure you regularly update your system with the latest security patches:
sudo apt update && sudo apt upgrade
Using the ufw Firewall
Ubuntu’s Uncomplicated Firewall (ufw) is an easy way to manage firewall rules.
To enable it, run:
sudo ufw enable
You can check its status with:
sudo ufw status
Managing User Permissions
You can add or remove users with the following commands:
To add a user in your system:
sudo adduser username
To remove a user from your system:
sudo deluser username
You can also give a user sudo (admin) privileges by adding them to the sudo group:
sudo usermod -aG sudo username
Cheat Sheet: Most Used Ubuntu Commands
Here’s a handy cheat sheet you can keep on hand for quick reference!
Command | Action |
---|---|
sudo apt update | Updates the list of available packages. |
sudo apt upgrade | Upgrades installed packages to their latest versions. |
ls -l | Lists files and directories with detailed information. |
cd directory | Changes to the specified directory. |
pwd | Prints the current working directory. |
mkdir folder_name | Creates a new folder. |
nano file_name | Opens the Nano text editor for the specified file. |
cp source dest | Copies a file from the source to the destination. |
mv source dest | Moves or renames a file. |
rm file_name | Deletes a file. |
sudo ufw enable | Enables the Ubuntu firewall. |
sudo snap install | Installs a Snap package. |
Feel free to print or save this cheat sheet to speed up your command-line work!
Conclusion
Ubuntu is a powerful operating system that might seem daunting at first, but with these basic commands and tools, you’ll be able to navigate, manage, and secure your system with ease. Whether you’re installing software, managing files, or tweaking security settings, these steps will get you up to speed quickly.
Ready to dive deeper into Ubuntu? Stay tuned for more in-depth guides and tips here on Skillspresso.