Chapter 1.5 - Fundamental Concepts
Learning Objectives
At the end of this chapter, you will be able to:
- Understand what a process is
- Explain the file system
- Understand users and permissions
- Use the shell to interact with the system
Introduction
Linux uses several fundamental concepts that you will constantly use. This chapter presents the most important ones: Processes, File System, Users, and Shell.
Processes: The Unit of Execution
Definition
A process is an instance of a program in execution.
Characteristics:
- Each process has a unique PID
- Parent and child processes (hierarchy)
- Isolated memory space
- Own files and resources
Process States
States:
- Running (R): Currently executing
- Sleeping (S): Waiting
- Stopped (T): Suspended
- Zombie (Z): Terminated but not cleaned up
File System: Data Organization
Hierarchical Structure
Important directories:
- /: System root
- /bin, /usr/bin: System executables
- /etc: Configuration files
- /home: User directories
- /var: Variable data (logs, cache)
- /tmp: Temporary files
Inodes and Metadata
Each file has an inode that contains:
- File type
- Permissions
- Owner and group
- Size
- Timestamps
- Pointers to data
Users and Permissions
User Types
Types:
- Root (superuser): Full access, UID 0
- Normal users: Limited access, UID ≥ 1000
- Groups: Shared permissions
File Permissions
Three levels:
- Owner: rwx
- Group: rwx
- Others: rwx
Types:
- r (read): Read
- w (write): Write
- x (execute): Execute
Example:
-rwxr-xr-- 1 user group 1024 Jan 1 12:00 file
# Owner: rwx (read, write, execute)
# Group: r-x (read, execute)
# Others: r-- (read only)
Shell: Interface with the System
What is a Shell?
The shell is the interface between the user and the system. It interprets commands.
Features:
- Command execution
- Scripting and automation
- Redirection and pipelines
- Environment variables
- Command history
Basic Commands
# Navigation
pwd # Where am I?
cd /home # Go to /home
ls -la # List files
# Files
cat file # Display content
cp src dst # Copy
mv src dst # Move/rename
rm file # Delete
# Processes
ps aux # View processes
top # Real-time monitoring
kill PID # Kill a process
Key Concepts Summarized
Summary
In this chapter, you learned:
Processes: Instance of a program, unique PID, states
File System: Hierarchical structure, inodes, directories
Users: Root, users, groups, permissions
Shell: Command line interface, commands, scripts
Permissions: rwx (read, write, execute)
Hierarchy: Processes and files organized in trees
Next Steps
Chapter 1.6: Installation and First Use
Module 2: Linux System Architecture
Chapter created on: December 2024