Introduction to Linux Desktop & Bash

Linux on a workstation gives a technician a desktop GUI plus a shell that talks straight to the kernel. A+ Core 2 tests whether you can identify that client stack and drive it with the command set in objective 1.9. Helpdesk tickets still land on Ubuntu laptops, Fedora workstations, and mixed labs. Candidates who map these tools to real tickets study faster on the CompTIA A+ Core 2 (220-1202) path.

What the Linux desktop actually is

A Linux desktop is a workstation OS. Objective 1.1 groups it with Windows, macOS, and Chrome OS. The machine boots firmware, the bootloader loads the kernel, the kernel starts systemd, and systemd brings up services, the display, and your login. After login you get a graphical desktop and a terminal. The terminal runs a shell. On most current Linux desktops that shell is Bash.

Bash reads a line, expands it, and execs a program. ls is not “Bash magic.” Bash finds /usr/bin/ls (or a builtin), the kernel runs it, and stdout comes back to the terminal. That is why 1.9 lists commands, not a desktop brand.

Linux stores files on Linux filesystems. Objective 1.1 names Fourth extended filesystem (ext4) and Extended filesystem (XFS). Windows-facing volumes on the same exam list use NTFS, ReFS, FAT32, and exFAT. macOS uses APFS. When a ticket says “Linux disk,” expect ext4 or XFS unless the prompt says otherwise.

File management: the shell as a file tool

These commands change the directory tree. They do not talk to systemd. They talk to the Virtual File System, and the kernel writes the inode and data blocks on ext4 or XFS.

pwd prints the working directory. Bash keeps that path in the process. Every relative path (docs/notes.txt) starts from here.

ls lists directory entries. The kernel returns inode metadata. Default ls hides names that start with a dot. ls -l prints mode bits, owner, group, size, and name. ls -a includes hidden entries such as .bashrc.

cp copies. It creates a new inode and copies data. The original stays. cp report.txt /tmp/report.txt writes a second file.

mv moves or renames. On the same filesystem the kernel updates the directory entry and leaves the data blocks in place. Across filesystems mv copies, then removes the source.

rm unlinks the directory entry. When the last link drops, the filesystem frees the blocks. rm does not send files to a recycle bin. Directories need rm -r. Confirm the path before you press Enter.

find walks a tree and matches tests. find /var/log -name “*.log” starts at /var/log and prints paths whose names match. It does not open file contents.

grep reads file contents (or stdin) and prints lines that match a pattern. grep error /var/log/syslog scans that file. Combine the two when you hunt: find locates names, grep reads insides.

chmod changes mode bits. Each file carries user/group/other permissions as read (r), write (w), and execute (x). Numeric form uses 4/2/1 per trio. chmod 644 file sets rw-r–r–. chmod 755 script.sh sets rwxr-xr-x so the owner can run it. Execute on a directory means “you may enter it.”

chown changes the owning user and, with a colon, the group. sudo chown ada:helpdesk ticket.txt points ownership at user ada and group helpdesk. Only a privileged account can steal or reassign ownership.

Filesystem management: attach and check disks

mount attaches a block device to a directory (a mount point). The kernel binds that device’s filesystem into the single Linux tree. mount /dev/sdb1 /mnt/usb makes the USB’s files appear under /mnt/usb. /etc/fstab lists devices that should mount at boot. Unmount before you yank removable media.

fsck checks and repairs a filesystem. Run it on an unmounted volume. On a live root disk, boot rescue media first. fsck reads metadata, looks for broken inodes and lost clusters, and writes repairs when you tell it to. A dirty ext4 journal often replayed cleanly at boot; a hard power loss may still need fsck.

Administrative access: root, su, and sudo

Linux has a root account. Root UID is 0. Root bypasses ordinary permission checks. Daily work uses a standard user. Privilege is borrowed, not lived in.

su switches user. su – with no name targets root and loads root’s login environment. You type root’s password. Many desktops lock the root password and expect sudo instead.

sudo runs one command as another user (default: root). The policy file decides who may run what. You authenticate with your password, not root’s. sudo dnf update raises one task, then drops back. Least privilege stays intact between commands.

Never practice rm, chmod, chown, fsck, or package upgrades as root on a production disk without a ticket and a rollback path.

Package management: apt vs dnf

A package is a signed bundle: binaries, libraries, config files, and dependency metadata. The package manager talks to a repository, resolves dependencies, then writes files and registers the package.

apt serves Debian-family desktops (Ubuntu and Linux Mint show up in most A+ labs). Flow:

Bash

sudo apt update
sudo apt install nano
sudo apt remove nano

update refreshes the index. install pulls the package and dependencies. remove takes the program and leaves most config.

dnf serves Fedora and current Red Hat-family clients (DNF replaced YUM; 1.9 lists dnf, not yum).

Bash

sudo dnf install nano
sudo dnf remove nano
sudo dnf upgrade

Match the tool to the distro on the prompt. Mixing apt onto a Fedora box fails because the on-disk database is not APT’s.

Network tools: ask the stack, do not guess

ip shows and sets interfaces, addresses, and routes. ip addr prints each NIC, its state, and its IPv4/IPv6 addresses. ip route prints the routing table. CompTIA lists ip, not the older ifconfig.

ping sends ICMP echo requests and prints replies plus round-trip time. A response proves L3 reachability to that address. No reply does not prove “the cable is bad.” It proves this host got no echo reply.

traceroute maps hops by sending probes with rising TTL and reading the ICMP Time Exceeded messages. Each hop is a router that decremented TTL to zero.

dig queries DNS. dig legacyhaven.university A asks for IPv4 records and prints the answer section plus the server that replied. Use it when names fail but raw IPs work.

curl speaks HTTP and other URL protocols. curl -I https://example.com fetches response headers. Technicians use it to test a web endpoint without opening a browser.

/etc/hosts is a static name-to-address file the resolver reads before or beside DNS, depending on configuration. /etc/resolv.conf lists DNS nameservers the stub resolver uses.

Informational commands: see the system without changing it

man opens the manual page for a command. man chmod is the first lookup when a flag is unclear.

cat writes a file’s bytes to stdout. cat /etc/fstab dumps the mount table. Do not cat binary files into a ticket note.

ps snapshots processes. ps aux (common portable form) lists PID, CPU, memory, and command line.

top refreshes that view live. CPU and memory hogs rise to the top. Press q to quit. top is the Linux cousin of Task Manager’s process list.

df reports filesystem free space. df -h prints human-sized totals per mount. A “disk full” ticket starts here.

du reports space used by a path. du -sh /home/* ranks home directories. df answers “how full is the volume.” du answers “which folder ate the space.”

nano and the five files CompTIA names

nano is the 1.9 text editor. sudo nano /etc/hosts opens the file, you edit, Ctrl+O writes, Ctrl+X exits. CompTIA does not list vim or gedit in 1.9.

Edit these paths only with a ticket and a backup copy:

FileWhat the system reads it for
/etc/passwdLocal user accounts: username, UID, GID, home, shell. Password hashes do not live here on a modern box.
/etc/shadowPassword hashes and aging. Mode is root-only. A leaked shadow file is a credential incident.
/etc/hostsStatic host-to-IP mappings.
/etc/fstabPersistent mounts: device, mount point, type (ext4, XFS, …), options. A bad line can stall boot.
/etc/resolv.confDNS resolver configuration.

cat them first. Change them with nano under sudo. Confirm with the matching tool (mount, dig, getent passwd) after you save.

OS components: bootloader, kernel, systemd

Bootloader (GRUB on most x86 desktops) sits in EFI or the disk’s boot area. Firmware runs it. It loads a kernel and an initramfs, then hands off.

Kernel talks to CPU, memory, disks, and NICs. Drivers live here. A kernel panic is the Linux stop screen. User programs never touch hardware directly; they call the kernel.

systemd is the init and service manager. It is PID 1 on current mainstream desktops. It starts units (services, mounts, timers) in dependency order and keeps them running. systemctl is the usual frontend; 1.9 names the component, not every subcommand.

Order of operations on power-on: firmware → bootloader → kernel → systemd → display manager → your session → Bash in a terminal.

How a helpdesk ticket uses this stack

A user says “Linux laptop, no internet.” You open a terminal. ip addr shows whether the NIC has an address. ping tests a numeric gateway, then a name. Failed names with a working ping send you to dig and /etc/resolv.conf. A full disk that blocks the browser shows up on df and du. A broken mount after a USB drop is mount plus /etc/fstab. A package the user “installed from a random site” is an apt/dnf question, not a GUI guessing game.

That loop is the 1.9 skill. The desktop is the face. Bash is the hands. The kernel and systemd are the floor.



Leave a Reply