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 .iso file.
  • 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 Desktop virtual 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-*.iso file 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 Super key + T) and type Terminal. 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):

    pwd
    

    This shows you your current location in the file system. It will likely be /home/your_username.

  • ls (List):

    ls
    

    This lists the files and directories in your current location.

  • ls -l (List Long Format):

    ls -l
    

    This gives you more details, like permissions, owner, size, and modification date.

  • cd (Change Directory):

    cd Documents
    

    This command moves you into the Documents directory. If you want to go back up one level, use cd ... To go to your home directory from anywhere, use cd or cd ~.

  • mkdir (Make Directory):

    mkdir my_new_folder
    

    This creates a new directory named my_new_folder in your current location.

  • touch (Create Empty File):

    touch my_new_file.txt
    

    This creates an empty file named my_new_file.txt.

  • cat (Concatenate and Display):

    cat my_new_file.txt
    

    This displays the content of a file. Since my_new_file.txt is empty, it will show nothing.

  • echo (Display a String):

    echo "Hello, Linux!" > my_new_file.txt
    

    This writes the text "Hello, Linux!" into my_new_file.txt, overwriting any previous content. The > symbol redirects output.

  • sudo (Superuser Do):

    sudo apt update
    

    This command allows you to run commands with administrative privileges. apt is a package manager for Ubuntu. apt update refreshes 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 update
    

    Always 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 htop
    

    Press Y when prompted to confirm.

  • Run the Software:

    htop
    

    You can exit htop by pressing F10 or q.

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.

Want structured learning?

Take the full Linux & Systems Programming course →