Ubuntu Tutorial

This Ubuntu tutorial introduces the basic tasks you need when working with Ubuntu, including navigating the file system, creating and managing files and directories, checking disk usage, changing permissions, and managing users. The tutorials are suitable for beginners who are learning Ubuntu through the graphical desktop, the Terminal, or both.

What Is Ubuntu?

Ubuntu is a Linux distribution based on Debian. It can be used as a desktop operating system, on servers, in virtual machines, and in cloud environments. Ubuntu includes graphical applications for everyday tasks and a command-line environment for administering the system and working efficiently with files, software, users, processes, and services.

Ubuntu uses the Linux file-system layout and Linux command-line tools. Therefore, many commands learned in an Ubuntu tutorial also apply to other Linux distributions, although software-management commands and some administrative details can differ between distributions.

Getting Started with the Ubuntu Terminal

The Terminal provides a command-line interface where you can enter commands directly. Many Ubuntu administration and file-management tutorials use the Terminal because the same commands can be repeated precisely and are useful on both desktop and server systems.

A few commands are especially useful when you begin working with Ubuntu:

  • pwd displays the current working directory.
  • ls lists files and directories.
  • cd changes the current directory.
  • mkdir creates a directory.
  • cp copies files or directories.
  • rm removes files and, with appropriate options, directories.
  • df reports file-system disk-space usage.
  • chmod changes file permissions.
</>
Copy
pwd
ls
cd Documents

Linux commands are generally case-sensitive. A file named Notes.txt, for example, is different from a file named notes.txt.

Ubuntu File System Operations Tutorials

Ubuntu organizes files and directories in a hierarchical file system beginning at the root directory, represented by /. These tutorials cover common operations for creating, locating, copying, deleting, and managing files and directories.

  • Ubuntu Tutorial – Create Directory
  • Ubuntu Tutorial – Copy Directory
  • Ubuntu Tutorial – Delete Directory
  • Ubuntu Tutorial – Show Current Directory
  • Ubuntu Tutorial – Create File
  • Ubuntu Tutorial – Copy File
  • Ubuntu Tutorial – Delete File
  • Ubuntu Tutorial – Change File Permission
  • Ubuntu Tutorial – Show Disk Space Usage

Navigate Ubuntu Directories from the Command Line

Before creating or deleting files, confirm which directory you are working in. The pwd command shows the absolute path of the current directory, while ls shows its contents.

</>
Copy
pwd
ls

Use cd followed by a path to move to another directory. The .. path refers to the parent directory, and ~ refers to the current user’s home directory.

</>
Copy
cd /var/log
cd ..
cd ~

Create and Manage Ubuntu Files and Directories

The mkdir command creates directories. The touch command is commonly used to create an empty file when the named file does not already exist.

</>
Copy
mkdir projects
touch notes.txt

Use cp to copy a file. To copy a directory together with its contents, use the recursive option -r.

</>
Copy
cp notes.txt notes-backup.txt
cp -r projects projects-backup

The rm command permanently removes files from the command line. It does not normally send them to the desktop Trash, so verify the path and file name before running it. A directory and its contents can be removed recursively with rm -r.

</>
Copy
rm notes-backup.txt
rm -r projects-backup

Ubuntu File Permissions and Ownership Basics

Linux permissions control whether the file owner, members of the file’s group, and other users can read, write, or execute a file. You can inspect permissions with ls -l.

</>
Copy
ls -l

The chmod command changes permissions. For example, the following command adds execute permission for the file owner:

</>
Copy
chmod u+x script.sh

When a command fails with a permission error, do not automatically prefix it with sudo. First check the file ownership, permissions, and the command you are trying to run. sudo executes an authorized command with elevated privileges and should be used only when administrative access is actually required.

Check Disk Space in Ubuntu

The df command displays available and used space for mounted file systems. Adding -h presents sizes in a human-readable format such as MB and GB.

</>
Copy
df -h

To estimate how much space a particular directory occupies, use du. The following command summarizes the size of the current directory:

</>
Copy
du -sh .

Ubuntu User Management Tutorials

Ubuntu is a multi-user operating system. Each user can have a separate home directory, account settings, password, groups, and permissions. Administrative privileges are normally controlled through group membership and sudo.

  • Ubuntu Tutorial – Create User
  • Ubuntu Tutorial – Change User Name
  • Ubuntu Tutorial – Change Password
  • Ubuntu Tutorial – Change User Permissions
  • Ubuntu Tutorial – Delete User

Identify the Current Ubuntu User

Use whoami to display the effective user name for the current shell. The id command shows the user’s numeric ID and group memberships.

</>
Copy
whoami
id

Create an Ubuntu User and Set a Password

On Ubuntu, adduser provides an interactive way to create a local user account. Creating or modifying user accounts requires administrative privileges.

</>
Copy
sudo adduser alice

To change your own password, run passwd. An administrator can specify another user name when changing that account’s password.

</>
Copy
passwd
sudo passwd alice

Ubuntu Package Management with APT

Ubuntu commonly uses APT to install and update software from configured package repositories. Before installing packages, you can refresh the local package index with apt update.

</>
Copy
sudo apt update

Install a package by supplying its package name to apt install. For example:

</>
Copy
sudo apt install curl

To install available upgrades for installed packages, first refresh the package index and then run the upgrade command:

</>
Copy
sudo apt update
sudo apt upgrade

Useful Ubuntu Commands for Beginners

The following command groups cover many everyday Ubuntu tasks. Learn what each command does before using options that modify or delete data.

CommandPurpose
pwdShow the current working directory
lsList directory contents
cdChange directory
mkdirCreate a directory
touchCreate an empty file or update timestamps
cpCopy files or directories
mvMove or rename files and directories
rmRemove files or directories
catPrint file contents
lessRead text one screen at a time
grepSearch text for matching patterns
df -hShow file-system disk usage
du -shSummarize directory or file size
chmodChange file permissions
whoamiShow the current effective user
sudoRun an authorized command with elevated privileges
aptManage packages on Ubuntu

How to Learn Ubuntu as a Beginner

A practical way to learn Ubuntu is to work through a small set of repeatable tasks rather than trying to memorize a long command list. Start by navigating directories, then create temporary files and directories, copy and rename them, inspect permissions, and finally remove only the test data you created.

  1. Open the Ubuntu Terminal.
  2. Use pwd to identify your current location.
  3. Use ls to inspect the directory contents.
  4. Create a practice directory with mkdir.
  5. Move into it with cd.
  6. Create a test file with touch.
  7. Copy or rename the file with cp or mv.
  8. Inspect permissions with ls -l.
  9. Return to the parent directory and remove only the practice files when finished.
  10. Continue with Ubuntu user-management and package-management commands after you are comfortable with file-system navigation.

Ubuntu Desktop and Ubuntu Server Command Differences

The core Linux commands shown in these tutorials work on both Ubuntu Desktop and Ubuntu Server. Ubuntu Desktop also provides graphical applications for tasks such as browsing files and changing many settings. Ubuntu Server is commonly administered through the command line, often over a remote connection such as SSH.

Commands can behave differently depending on the Ubuntu release, installed packages, shell, account permissions, and system configuration. When following an Ubuntu tutorial, check the command and its options before applying it to important files or a production system.

Ubuntu Tutorial Editorial QA Checklist

  • Verify that file-system commands use valid Ubuntu/Linux syntax and clearly distinguish files from directories.
  • Confirm that destructive commands such as rm explain that command-line deletion can be permanent.
  • Check that examples involving administrative tasks use sudo only when elevated privileges are required.
  • Verify that permission examples distinguish reading permissions from changing ownership or group membership.
  • Check Ubuntu package-management examples against the APT workflow used by supported Ubuntu releases.
  • Confirm that user-management examples do not assume every account should receive administrative privileges.
  • Make sure paths and file names in command examples are internally consistent and case-sensitive where relevant.
  • Review release-specific instructions whenever an Ubuntu version, package, desktop environment, or system service is named.

Conclusion

Concluding this series of Ubuntu Tutorials, we learned about different aspects of Ubuntu and different operations that we can perform, with well detailed tutorials.

For beginners, the most useful starting point is understanding directories, paths, files, permissions, users, and basic Terminal commands. Once these concepts are familiar, you can move on to package management, services, networking, shell scripting, and other Ubuntu administration tasks.