Users, Root, and Sudo

Users, Root, and Sudo

Concepts

Users on Linux

Every Linux system has multiple user accounts, even if you are the only person using it. Each user has:

Attribute Description Example
Username Human-readable login name kmiguel
UID Numeric user ID (the kernel uses this, not the username) 1000
GID Primary group ID 1000
Home directory Personal directory /home/kmiguel
Login shell Shell started at login /bin/bash
Password Stored as a hash (not plaintext) (in /etc/shadow)

User categories:

[Read more]

Variables and Quoting

Variables and Quoting

Concepts

Variables

Variables store values (text or numbers) that you can use later.

Setting Variables

name="Alice"               # string (no spaces around `=` !)
age=30                      # number (stored as string internally)
path="/var/log"             # path
greeting="Hello, $name"    # variable expansion inside double quotes

Critical rule: No spaces around =. This is wrong and will fail:

name = "Alice"     # WRONG — bash interprets "name" as a command

Using Variables

Prefix with $ or wrap in ${}:

[Read more]

vim

vim

Concepts

Why vim?

vim (Vi Improved) is the most widely available text editor on Unix/Linux systems. Some form of vi exists on virtually every Linux installation, even minimal server images where nano is not installed. vim is extremely powerful once learned, but has a steep learning curve because it works fundamentally differently from editors you may be used to.

Learning vim is not mandatory for this course — nano is sufficient for editing files. But understanding vim basics will serve you well when you encounter a system where it is the only available editor.

[Read more]

What Is Linux

What Is Linux

Concepts

The Kernel and the Operating System

When people say “Linux,” they usually mean one of two things:

  1. The Linux kernel — a piece of software that sits between your hardware (CPU, RAM, disk, network card) and everything else. The kernel manages resources: it decides which program gets CPU time, how memory is allocated, how data flows to and from disks and network interfaces. You never interact with it directly.

[Read more]

Your First Script

Your First Script

Concepts

What Is a Shell Script?

A shell script is a text file containing a sequence of commands that the shell executes in order. Instead of typing commands one by one, you write them in a file and run the file. Scripts automate repetitive tasks, glue commands together, and can include logic (decisions, loops).

The Shebang

The first line of every script should be the shebang (also called hashbang):

[Read more]