Linux has been powering the internet, supercomputers, and most of the world’s mobile devices for decades, yet most people have never even seen it.
Let’s get you set up with a basic Linux environment so you can start exploring. We’ll use Ubuntu, a popular and beginner-friendly distribution.
1. Installing Ubuntu
The easiest way to try Linux without altering your current operating system is to use a virtual machine. We’ll use VirtualBox, a free virtualization software.
- Download VirtualBox: Go to https://www.virtualbox.org/wiki/Downloads and download the version for your operating system (Windows, macOS, or Linux).
- Install VirtualBox: Run the installer and follow the on-screen prompts.
- Download Ubuntu Desktop: Go to https://ubuntu.com/download/desktop and download the latest LTS (Long Term Support) version. This will be an
.isofile. - Create a New Virtual Machine:
- Open VirtualBox.
- Click "New."
- Name:
Ubuntu Desktop - Type:
Linux - Version:
Ubuntu (64-bit) - Click "Next."
- Memory size: Allocate at least
4096 MB(4GB). - Click "Next."
- Hard disk: Select "Create a virtual hard disk now."
- Click "Create."
- Hard disk file type:
VDI (VirtualBox Disk Image) - Click "Next."
- Storage on physical hard disk:
Dynamically allocated - Click "Next."
- File location and size: Allocate at least
25 GB. - Click "Create."
2. Starting Ubuntu and Installing It
- Select Your New VM: In VirtualBox, click on your
Ubuntu Desktopvirtual machine. - Start the VM: Click the "Start" button.
- Select Startup Disk: A window will pop up asking for a startup disk. Click the folder icon, then "Add," and browse to the
ubuntu-*.isofile you downloaded. Select it and click "Choose," then "Start." - Ubuntu Installer: You’ll boot into the Ubuntu installer.
- Choose "Try or Install Ubuntu."
- Select your keyboard layout.
- Choose "Normal installation" and check "Download updates while installing Ubuntu" and "Install third-party software for graphics and Wi-Fi hardware…"
- Choose "Erase disk and install Ubuntu." This is safe because it only affects the virtual hard disk we created.
- Click "Install Now."
- Confirm the disk changes by clicking "Continue."
- Select your time zone.
- Create your user account: Enter your name, your computer’s name, a username, and a password. Remember this password!
- Click "Continue." The installation will proceed.
- Restart: Once the installation is complete, click "Restart Now." When prompted, remove the installation medium (VirtualBox will usually do this automatically, or you’ll be asked to press Enter).
3. Exploring the Ubuntu Desktop
You’ll now boot into your newly installed Ubuntu system.
- Login: Enter the password you created.
- The Desktop: You’ll see the Ubuntu desktop. The dock on the left side contains your applications.
- Files: Click the folder icon to open the file manager.
- Web Browser: Firefox is pre-installed.
- Terminal: This is your command-line interface. Click the grid icon in the dock (or press
Superkey +T) and typeTerminal. This is where you’ll do most of your learning.
4. The Command Line Interface (CLI)
The terminal is incredibly powerful. Let’s run a few commands.
-
pwd(Print Working Directory):pwdThis shows you your current location in the file system. It will likely be
/home/your_username. -
ls(List):lsThis lists the files and directories in your current location.
-
ls -l(List Long Format):ls -lThis gives you more details, like permissions, owner, size, and modification date.
-
cd(Change Directory):cd DocumentsThis command moves you into the
Documentsdirectory. If you want to go back up one level, usecd ... To go to your home directory from anywhere, usecdorcd ~. -
mkdir(Make Directory):mkdir my_new_folderThis creates a new directory named
my_new_folderin your current location. -
touch(Create Empty File):touch my_new_file.txtThis creates an empty file named
my_new_file.txt. -
cat(Concatenate and Display):cat my_new_file.txtThis displays the content of a file. Since
my_new_file.txtis empty, it will show nothing. -
echo(Display a String):echo "Hello, Linux!" > my_new_file.txtThis writes the text "Hello, Linux!" into
my_new_file.txt, overwriting any previous content. The>symbol redirects output. -
sudo(Superuser Do):sudo apt updateThis command allows you to run commands with administrative privileges.
aptis a package manager for Ubuntu.apt updaterefreshes the list of available software packages. You’ll be prompted for your password.
5. Installing Software
The apt command is how you install software.
-
Update Package Lists:
sudo apt updateAlways do this first to ensure you’re getting the latest information.
-
Install a Package: Let’s install
htop, a more advanced process viewer.sudo apt install htopPress
Ywhen prompted to confirm. -
Run the Software:
htopYou can exit
htopby pressingF10orq.
You’ve now got a working Linux environment and have taken your first steps with the command line. The next logical step is to understand how the Linux file system is structured and how to navigate it more effectively.