Linux Administration Course: Installation, Shell, Storage, Networking, and Permissions
Learn Linux administration from installation and desktop use to shell commands, storage, networking, permissions, services, and troubleshooting.
Linux Administration Course Overview
This course introduces Linux administration for personal computers, virtual machines, workstations, and servers. You will learn how to install a Linux distribution, use its graphical desktop, work in a shell, manage files and software, control permissions, administer storage and networking, and diagnose common system problems.
You need only basic computer literacy: understanding files, folders, applications, and simple settings. Practice on a virtual machine or spare computer whenever a command could alter disks, users, services, or system configuration.
1. Linux Foundations
Linux is an operating-system ecosystem centered on the Linux kernel. The kernel is the core component that manages hardware, memory, processes, device access, and other low-level functions. A complete usable system combines the kernel with utilities, libraries, software, configuration, and often a graphical desktop.
Linux is used on desktops and laptops, web and database servers, embedded devices, routers, appliances, mobile-oriented platforms, scientific systems, supercomputers, and large-scale cloud infrastructure. The same kernel family can support very different systems because distributions select and integrate different software.
How the parts fit together
- Kernel: communicates with hardware and provides core operating-system services.
- Distribution: a packaged Linux system containing the kernel, installer, repositories, utilities, update system, and possibly a desktop environment.
- Desktop environment: the graphical workspace, including panels, menus, windows, settings, and graphical applications.
- Shell: a command interpreter that accepts commands and can automate tasks.
- Applications: programs such as browsers, editors, media players, databases, and web servers.
- System utilities: tools for networking, storage, users, services, logs, and package management.
Common distribution families include Debian-based systems, Red Hat-based systems, SUSE-based systems, and Arch-based systems. Families may use different package formats, commands, configuration conventions, release schedules, and support models. The administration concepts remain similar even when the commands differ.
| Distribution family | Typical package format | Common package commands | Typical use case |
|---|---|---|---|
| Debian family | .deb | apt | Beginner desktops, servers, broad documentation |
| Red Hat family | .rpm | dnf, sometimes yum | Servers, enterprise environments, workstations |
| SUSE family | .rpm | zypper | Enterprise and general-purpose systems |
| Arch family | Distribution-specific packages | pacman | Users who want current software and detailed control |
2. Preparing to Install Linux
Choose a distribution
For a first installation, choose a distribution with good hardware support, clear community documentation, a stable release model, and a large package ecosystem. A mainstream beginner-oriented distribution with a graphical installer is usually easier than a highly customized or minimal distribution. Also consider whether you need long-term support, newer hardware drivers, a particular desktop environment, or compatibility with software used by your organization.
Choose an installation method
- Physical hardware: provides direct access to the computer's devices and performance, but partitioning or replacing an existing operating system can affect data.
- Virtual machine: is safer for learning because the virtual disk can be backed up, reset, or deleted. It may have limited graphics, memory, or device access.
- Cloud or remote server: is useful for server practice and usually starts from a provider image. You must plan remote access, credentials, firewall rules, backups, and recovery access.
Obtain and verify installation media
Download an installation image from the distribution's official distribution channel. Verify its checksum against the published checksum, or verify a digital signature when the project provides one. A checksum confirms that the file matches the expected content; a signature also helps establish that the checksum came from a trusted publisher.
sha256sum linux-installer.isoCompare the displayed value exactly with the expected SHA-256 value. Do not use an image whose verification fails.
Create bootable media
Use a trusted image-writing tool to write the image to a USB device. Writing an image normally erases the selected USB device, so identify the target carefully. On physical hardware, open the firmware boot menu or adjust the boot order when the computer does not start from USB. Firmware settings may include UEFI, Secure Boot, storage-controller modes, and virtualization support.
Back up before changing disks
Back up documents, browser data, keys, and any configuration you need. Confirm that the backup can be opened. Replacing an operating system, deleting partitions, or selecting an entire disk for automatic installation can destroy existing data. Dual booting adds complexity: reserve unallocated space, keep recovery media, avoid shrinking a mounted or encrypted volume casually, and understand which bootloader controls startup.
3. Linux Installation Workflow
Installers differ visually, but their decisions are broadly similar:
- Select language, region, and keyboard layout.
- Connect to a network if practical so the installer can obtain updates.
- Choose a time zone and time settings.
- Create a normal user account and a strong password. Some installers also configure administrative access through
sudo. - Select the disk and installation type.
- Choose software or package groups, such as a desktop, office tools, or a minimal server set.
- Confirm the bootloader location and review the final disk summary.
- Install, reboot, remove the installation media, and sign in.
Automatic and manual partitioning
Automatic partitioning lets the installer choose a practical layout. It is usually best for a new learner using a dedicated virtual disk or empty computer. Manual partitioning gives control over partitions, encryption, filesystems, and mount points, but an incorrect selection can erase another system.
/, called the root filesystem, contains the main system tree./homecontains users' personal files and settings. A separate/homefilesystem can simplify some reinstallations, but it does not replace backups./bootmay contain boot files. Its exact layout depends on firmware and distribution choices.- Swap is disk space used for memory management and, on some systems, hibernation. It may be a partition or a swap file.
After first boot, apply updates, install required drivers through trusted tools, check display, audio, storage, network, suspend, and external devices, and confirm that the system starts normally after another reboot.
4. Using the Graphical Desktop
A desktop environment commonly includes an application launcher, a panel or taskbar, a settings application, a file manager, notifications, a network tool, and a terminal emulator. Names and placement vary between desktop environments, but the underlying concepts are similar.
- Use the file manager to browse folders, copy or move items, connect to removable media, and inspect properties.
- Use settings to configure displays, keyboard layouts, users, privacy, power, printers, and network connections.
- Use the software tool to search for applications, install updates, and remove packages from configured repositories.
- Use the terminal emulator when you need repeatable commands, detailed output, remote administration, automation, or access to options not exposed graphically.
Graphical tools are convenient for discovery and one-off user tasks. Terminal tools are often preferable for repeatable administration, troubleshooting, servers without displays, and operations that need a precise record. They are complementary approaches, not competing systems.
5. Terminal and Shell Fundamentals
A terminal emulator is a graphical program that provides a text interface. It starts a shell, which interprets commands. A prompt may show your username, computer name, and current directory.
Most commands follow this pattern:
command [options] [arguments]Options change behavior, while arguments identify files, directories, or other targets. Spaces separate words. Quoting preserves spaces or special characters.
echo 'Project notes' > notes.txt
ls -l "Project Files"Wildcards, also called globbing, are expanded by the shell. * matches zero or more characters, ? matches one character, and bracket expressions match selected characters. Always inspect a wildcard expansion before a destructive command.
printf '%s\n' ./*.log
ls -ld -- ./old-*Absolute paths begin at /, such as /home/alex/docs. Relative paths begin at the current working directory, such as docs/report.txt. The current directory is ., the parent is .., and ~ means the current user's home directory.
| Command | Purpose | Common options | Example task | Safety note |
|---|---|---|---|---|
pwd | Print current directory | None commonly needed | pwd | Safe |
ls | List directory contents | -l, -a, -h | ls -lah | Inspect hidden files with -a |
cd | Change directory | -, ~ | cd ~/Documents | Use pwd to confirm location |
mkdir | Create directories | -p | mkdir -p project/src | Confirm the path before creating |
cp | Copy files or directories | -i, -r, -a | cp -i report.txt backup/ | Use -i before overwriting |
mv | Move or rename | -i | mv -i draft.txt final.txt | Can overwrite a destination |
rm | Remove files | -i, -r | rm -i sample.txt | No normal recycle bin; avoid broad wildcards |
find | Search by name and properties | -name, -type, -size | find . -type f -name '*.log' | Test searches before adding actions |
grep | Search text | -i, -n, -r | grep -n 'error' app.log | Quote patterns when needed |
less | Read text interactively | None commonly needed | less /var/log/syslog | Read-only |
Input, output, errors, and pipelines
Commands conventionally use standard input for incoming data, standard output for normal results, and standard error for diagnostic messages. A pipe sends one command's standard output to another command's standard input.
ls -l | less
cat app.log | grep -i error
command > result.txt
command >> result.txt
command < input.txt
command 2> errors.txt
command1 && command2> replaces a file, while >> appends. 2> redirects standard error. && runs the second command only if the first succeeds. Use history to review previous commands and the shell's arrow keys to recall them.
Documentation
man ls
ls --help
help cd
command --helpManual pages are organized by sections and usually include synopsis, options, examples, and related commands. Read documentation before using an unfamiliar administrative option.
6. Filesystem and File Management
Linux presents hardware and many system interfaces through a single hierarchical tree beginning at /. Important directories include:
| Directory | Primary purpose | Common contents | Administrative cautions |
|---|---|---|---|
/ | Top of the filesystem tree | All major directories | Changes affect the entire system |
/home | Personal user data | User directories and settings | Protect privacy and backups |
/etc | System configuration | Service and account configuration | Back up before editing |
/var | Changing system data | Logs, caches, queues, databases | Can fill a filesystem |
/usr | Installed programs and shared data | Binaries, libraries, documentation | Prefer package management over manual deletion |
/tmp | Temporary data | Short-lived application files | Contents may be cleaned automatically |
/dev | Device interfaces | Disk, terminal, and device nodes | Writing to the wrong device can destroy data |
/proc | Kernel and process information | Virtual status files | Not ordinary persistent storage |
/mnt | Common temporary mount location | Mounted disks and filesystems | Unmount before disconnecting media |
Useful file operations include:
mkdir -p ~/course/project
cd ~/course/project
touch notes.txt
cp notes.txt notes-copy.txt
mv notes-copy.txt archive.txt
find ~/course -type f -name '*.txt'
head -n 5 archive.txt
tail -f application.logUse a terminal editor such as nano for basic text changes: nano filename. Learn how to save and exit before editing important configuration. For larger changes, make a backup and change one setting at a time.
Archives combine files; compression reduces their size. A common administration pattern is:
tar -czf project.tar.gz project/
tar -tzf project.tar.gz
tar -xzf project.tar.gzThe first command creates a gzip-compressed archive, the second lists its contents, and the third extracts it. Use unzip for ZIP archives and avoid extracting untrusted archives into sensitive directories.
7. Software and Package Management
A package is a managed unit of software and metadata. Metadata can include the version, dependencies, description, files, and signing information. A repository is a trusted software source that provides package metadata and packages. A package manager resolves dependencies, installs files, records ownership, applies updates, and removes software cleanly.
The general workflow is search, inspect, install, update, remove, and clean. Examples vary by family:
# Debian family
sudo apt update
apt search package-name
apt show package-name
sudo apt install package-name
sudo apt remove package-name
sudo apt upgrade
# Red Hat family
sudo dnf search package-name
sudo dnf info package-name
sudo dnf install package-name
sudo dnf remove package-name
sudo dnf upgradeyum, zypper, and pacman provide equivalent concepts with different syntax. Refreshing metadata and applying security updates regularly reduces exposure to known vulnerabilities. Remove unused packages and caches only with the package manager's supported commands.
8. Users, Groups, Ownership, and Permissions
Linux is designed for multiple users. A standard user performs routine work with limited privileges. A group collects users so shared access can be managed. The root account has unrestricted administrative power. The word root can also mean the top-level directory /; context distinguishes the two.
whoami
id
id username
groups
sudo useradd -m alice
sudo passwd alice
sudo groupadd project
sudo usermod -aG project alice
sudo userdel -r aliceSome distributions provide adduser as an interactive alternative to useradd. Use usermod to change account properties and groupadd to create groups. A user may need to sign out and in again before new group membership is reflected in a session.
Permission model
Each filesystem object has an owner, a group owner, and permissions for the owner, group, and others. Permissions are read (r), write (w), and execute (x).
| Permission | Files | Directories | Symbolic notation | Numeric value |
|---|---|---|---|---|
| Read | View contents | List names | r | 4 |
| Write | Change contents | Create, remove, or rename entries | w | 2 |
| Execute | Run as a program | Enter or traverse | x | 1 |
ls -l report.txt
chmod u=rw,g=r,o= report.txt
chmod 640 report.txt
sudo chown alice:project report.txt
sudo chgrp project shared/
chmod 2770 shared/chmod 640 means owner read/write (6), group read (4), and others no access (0). A shared workspace can be owned by a group and use group read/write/execute permissions. Directory execute permission is required to access entries inside it, even if the entries themselves are readable.
sudo runs an authorized command with elevated privileges. Use it for a specific administrative action rather than conducting an entire session as root. Advanced permission features include setuid, setgid, and the sticky bit; understand their security implications before using them.
9. Disk and Storage Administration
A physical or virtual disk may contain partitions. A partition can contain a filesystem, such as ext4 or XFS. A filesystem becomes accessible when it is attached to a directory called a mount point. These layers should be identified separately.
| Concept | Description | How to inspect it | Common administrative action |
|---|---|---|---|
| Disk | Physical or virtual storage device | lsblk | Partition or replace in a practice environment |
| Partition | Logical division of a disk | fdisk -l, parted | Create or resize carefully |
| Filesystem | Structure used to store files | blkid, lsblk -f | Create with mkfs on an empty target |
| Mount point | Directory exposing a filesystem | findmnt, mount | Mount or unmount storage |
| Capacity | Used and available space | df -h, du -sh | Remove or relocate unnecessary data |
| Inodes | Filesystem records for files | df -i | Find and reduce excessive small files |
lsblk -f
sudo blkid
sudo mkdir -p /mnt/practice
sudo mount /dev/sdb1 /mnt/practice
findmnt /mnt/practice
sudo umount /mnt/practice
df -h
du -sh /var/*Never run mkfs on a device containing needed data. In a disposable practice disk, the general sequence is to identify the correct device, create a partition if needed, create a filesystem, create a mount point, mount it, and assign appropriate ownership or permissions.
Persistent mounts are configured in /etc/fstab. Prefer a filesystem UUID rather than a device name that may change:
sudo blkid /dev/sdb1
# Example fstab concept:
UUID=example-uuid /mnt/practice ext4 defaults 0 2
sudo mount -a
findmnt /mnt/practiceValidate an edited /etc/fstab with mount -a before rebooting. A syntax or device error can affect startup. Swap can be inspected with swapon --show and memory pressure with tools such as free.
10. Networking Configuration and Diagnostics
A network interface is a device or virtual adapter. It receives an IP address and prefix, such as 192.0.2.20/24. The prefix describes the local network range. A default gateway forwards traffic beyond the local network. DNS translates hostnames into IP addresses. DHCP automatically supplies addresses and related settings. The loopback interface, usually lo with address 127.0.0.1, tests the local network stack.
ip link
ip addr
ip route
hostnamectl
ss -tuln
nmcli device status
nmcli connection showGraphically, select the network icon, choose a connection, and configure automatic DHCP or a static address, gateway, and DNS servers. On many systems, nmcli manages NetworkManager connection profiles. Other distributions may use different persistence systems, so inspect the distribution's documentation before editing network files.
| Test | Command or tool | What success indicates | Likely issue when it fails |
|---|---|---|---|
| Interface state | ip link | Adapter exists and is up | Disabled interface, driver, cable, or virtual-device issue |
| Assigned address | ip addr | Interface has a usable address | DHCP or static configuration failure |
| Local stack | ping -c 3 127.0.0.1 | TCP/IP stack responds locally | Rare local stack or firewall problem |
| Gateway | ping -c 3 gateway-address | Local routing works | Link, address, prefix, or gateway problem |
| External IP | ping -c 3 external-ip | Routing beyond the local network works | Default route, upstream, or firewall problem |
| Hostname resolution | resolvectl query example-hostname or dig example-hostname | DNS returns an address | Resolver or DNS configuration problem |
Test in order: interface, address, loopback, gateway, external IP, then hostname. If an IP works but a hostname does not, investigate DNS using resolvectl or dig. traceroute or tracepath can help reveal where routing stops. Configure the hostname with hostnamectl when supported.
11. Processes, Services, and System Operation
A process is a running instance of a program and has a process identifier (PID). Foreground jobs occupy the terminal. Background jobs continue while the shell is available for other work.
ps aux
top
pgrep -a process-name
command &
jobs
bg %1
fg %1
kill PID
kill -TERM PIDUse a normal termination signal first. Forceful termination should be a last resort because it may prevent cleanup or data flushing.
A service is a background process managed by the operating system, often providing a system or network function. On systems using systemd, use:
systemctl status service-name
sudo systemctl start service-name
sudo systemctl stop service-name
sudo systemctl restart service-name
sudo systemctl enable service-name
sudo systemctl disable service-name
journalctl -u service-name -b
journalctl -u service-name --since '30 minutes ago'start and stop affect the current boot. enable controls whether a service starts automatically in future boots. Check status after every change. Use shutdown or reboot for controlled system operation, and log out or close a session rather than terminating a graphical session abruptly.
12. System Maintenance and Troubleshooting
Routine maintenance includes installing security updates, checking available disk space and inodes, reviewing memory and processes, checking important service health, and reading relevant logs. Use package-manager cleanup features rather than deleting managed files manually.
Use this troubleshooting method:
- Describe the symptom precisely.
- Gather evidence with status commands, logs, configuration inspection, and recent change history.
- Form one likely explanation.
- Make one controlled change.
- Test the result and compare it with the original symptom.
- Record the change and result so the system remains understandable.
Common diagnostic paths
- Permission denied: inspect
ls -l,id, group membership, and execute permission on parent directories. Correct ownership or permissions only as necessary; usesudoonly when appropriate. - Hostname fails but an IP works: inspect the active address, gateway, DNS configuration, and query results. The likely fault is name resolution rather than basic routing.
- Attached disk is invisible: use
lsblk -f,blkid, andfindmntto determine whether the disk has a partition, filesystem, and mount point. Check/etc/fstabfor persistent mounting. - Package installation fails: confirm networking, refresh metadata, read repository errors, check package locks or interrupted transactions, and verify free space.
- Service will not start: inspect
systemctl statusandjournalctl, then check configuration syntax, dependencies, ports, ownership, permissions, and required resources. - Filesystem is full: run
df -h, locate large paths withdu, inspect logs and caches, and rundf -iwhen space appears available but file creation still fails.
Back up before high-risk configuration, partitioning, upgrades, or permission changes. Recovery options may include restoring a configuration backup, booting recovery media, using a previous kernel, mounting a filesystem from another environment, or restoring from a tested backup.
13. Practical Administration Workflows
Build a safe practice system
- Choose a beginner-friendly distribution with suitable hardware support.
- Install it in a virtual machine or on spare hardware.
- Create a normal user with administrative access through
sudo. - Apply initial updates and confirm network, display, storage, and reboot behavior.
Create and organize project files
mkdir -p ~/course/project/{docs,src,backup}
touch ~/course/project/docs/notes.txt
cp ~/course/project/docs/notes.txt ~/course/project/backup/
mv ~/course/project/docs/notes.txt ~/course/project/docs/plan.txt
find ~/course/project -type f
rm -i ~/course/project/backup/notes.txtPerform the same actions in the file manager, then compare the visible operations with the commands. This builds understanding of how graphical tools represent filesystem actions.
Create a shared workspace
sudo groupadd project
sudo usermod -aG project alice
sudo usermod -aG project bob
sudo mkdir -p /srv/project
sudo chown root:project /srv/project
sudo chmod 2770 /srv/project
ls -ld /srv/projectThe group can collaborate in the directory while unrelated users are denied. Verify access by signing in as each account and creating test files. The setgid directory bit helps new entries inherit the directory's group on many Linux filesystems.
Attach and persist storage
- Identify the additional virtual disk with
lsblk. - Create a filesystem only on the confirmed, empty practice target.
- Create a mount point and mount the filesystem.
- Find its UUID with
blkid. - Add a carefully reviewed entry to
/etc/fstab. - Run
mount -aand verify withfindmntbefore rebooting.
Investigate a failing service
- Run
systemctl status service-name. - Read recent entries with
journalctl -u service-name. - Check configuration syntax, file permissions, dependencies, and port conflicts.
- Make one correction, restart the service, and check status again.
- Enable it only if it should start automatically.
14. Exam-Relevant Notes
- Linux is the ecosystem; the kernel is its core, and a distribution packages a complete usable system around it.
/is the root directory; root can also mean the unrestricted administrative account.- Absolute paths begin with
/; relative paths depend on the current working directory;~means the current user's home. - Standard output, standard error, pipes, and redirection are separate shell concepts.
- Directory execute permission means traversal, not merely running a program.
- Package managers track dependencies and files; avoid manually replacing package-managed files.
- A disk, partition, filesystem, and mount point are different layers.
- Use UUID-based entries in
/etc/fstaband validate them safely. - Test networking from the local interface through the gateway and external IP before diagnosing DNS.
- Use least privilege, prefer
sudofor individual tasks, and verify every administrative change. - Logs and documentation are evidence; do not guess when a status command or manual page can answer the question.
Next Steps
After completing these fundamentals, continue with Bash scripting, shell text processing, secure remote administration with SSH, Linux security hardening, firewall management, scheduled tasks, backup and recovery, virtualization, containers, and server administration.
See the broader Linux learning area for related Linux topics.