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:
pwddisplays the current working directory.lslists files and directories.cdchanges the current directory.mkdircreates a directory.cpcopies files or directories.rmremoves files and, with appropriate options, directories.dfreports file-system disk-space usage.chmodchanges file permissions.
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.
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.
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.
mkdir projects
touch notes.txt
Use cp to copy a file. To copy a directory together with its contents, use the recursive option -r.
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.
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.
ls -l
The chmod command changes permissions. For example, the following command adds execute permission for the file owner:
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.
df -h
To estimate how much space a particular directory occupies, use du. The following command summarizes the size of the current directory:
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.
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.
sudo adduser alice
To change your own password, run passwd. An administrator can specify another user name when changing that account’s password.
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.
sudo apt update
Install a package by supplying its package name to apt install. For example:
sudo apt install curl
To install available upgrades for installed packages, first refresh the package index and then run the upgrade command:
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.
| Command | Purpose |
|---|---|
pwd | Show the current working directory |
ls | List directory contents |
cd | Change directory |
mkdir | Create a directory |
touch | Create an empty file or update timestamps |
cp | Copy files or directories |
mv | Move or rename files and directories |
rm | Remove files or directories |
cat | Print file contents |
less | Read text one screen at a time |
grep | Search text for matching patterns |
df -h | Show file-system disk usage |
du -sh | Summarize directory or file size |
chmod | Change file permissions |
whoami | Show the current effective user |
sudo | Run an authorized command with elevated privileges |
apt | Manage 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.
- Open the Ubuntu Terminal.
- Use
pwdto identify your current location. - Use
lsto inspect the directory contents. - Create a practice directory with
mkdir. - Move into it with
cd. - Create a test file with
touch. - Copy or rename the file with
cpormv. - Inspect permissions with
ls -l. - Return to the parent directory and remove only the practice files when finished.
- 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
rmexplain that command-line deletion can be permanent. - Check that examples involving administrative tasks use
sudoonly 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.
TutorialKart.com