Introduction to the foundations of Unix and Linux systems
By the end of this module, you will be able to:
Unix was developed in the late 1960s and early 1970s at Bell Labs by Ken Thompson, Dennis Ritchie, and others. It embodied several key principles that continue to influence operating system design today:
These principles led to the creation of a modular system where small, focused tools could be combined in powerful ways.
Linux was created in 1991 by Linus Torvalds as a free and open-source alternative to Unix. Some key milestones:
Today, Unix and Linux systems power:
Linux distributions (“distros”) can be grouped into several major families:
Factors to consider when selecting a distribution:
The kernel is the core of the operating system that:
Linux follows a standardized directory structure:
command [options] [arguments]# Create directories
mkdir directory_name
mkdir -p parent/child/grandchild # Create parent directories as needed
# Create empty files
touch filename
# Copy files and directories
cp source destination
cp -r source_dir destination_dir # Recursive copy for directories
# Move/rename files and directories
mv source destination
# Remove files and directories
rm filename
rm -r directory # Recursive deletion
rm -i filename # Interactive mode (asks for confirmation)
rm -f filename # Force deletion without confirmation
# Be very careful with rm, especially rm -rf!# View file contents
cat filename # Display entire file
less filename # Paginated viewing
head filename # First 10 lines
head -n 20 filename # First 20 lines
tail filename # Last 10 lines
tail -f filename # Follow file updates in real-time
# File information
file filename # Determine file type
stat filename # Detailed file information# Search within files
grep pattern filename
grep -i pattern filename # Case-insensitive
grep -r pattern directory # Recursive search
# Stream editing
sed 's/old/new/g' filename # Replace text
# Text manipulation
cut -d ',' -f 1,3 filename # Extract columns from CSV
sort filename # Sort lines
uniq filename # Remove duplicate lines
wc filename # Count lines, words, characters# User information
whoami # Current username
id # User and group IDs
who # Who is logged in
w # Who is logged in and what they're doing
# System information
uname -a # Kernel and system information
hostname # System hostname
uptime # How long the system has been running
date # Current date and time
# Resource usage
free -h # Memory usage
df -h # Disk usage
du -sh directory # Directory size
top # Process information (interactive)
ps aux # Process listingThe man command provides detailed documentation for most commands:
Navigation in man pages: - Space/Page Down: Next page - b/Page Up: Previous page - /pattern: Search forward - n: Next search match - q: Quit
The GNU project’s documentation system:
Most commands offer built-in help:
Create a script or series of commands to gather the following information about your Linux system:
Solve the following tasks using command-line tools:
Next week, we’ll dive deeper into user and permission management, covering user accounts, groups, file permissions, access control lists, and security best practices.