Linux Programming and Cloud Computing
Permissions, Ownership and Access Control Lists
PGCP-BDA
user and group identity
Numeric user and group IDs identify principals and are used with ownership and permission bits during access checks.
read write execute permissions
Linux records read, write and execute bits for the owning user, owning group and all other users.
directory permissions
Read permits listing directory entries, write permits adding or removing entries and execute permits pathname traversal and access to known entries.
chmod
chmod changes mode bits using symbolic expressions such as g+w or octal values such as 640; it does not change file ownership.
chown and chgrp
chown changes a file’s owning user and optionally group, while chgrp changes only its group ownership, subject to privilege and filesystem rules.
umask
The process umask removes permission bits from the mode requested when a new file or directory is created
setuid setgid sticky bit
Setuid or setgid can change effective identity on execution; on directories setgid inherits the group and the sticky bit restricts deletion.
access control list
A POSIX access control list adds permissions for named users and groups beyond the file owner's traditional user-group-other mode bits.
ACL mask
The ACL mask is the maximum effective permission granted to named users, named groups and the owning group.
least privilege
Granting each identity only the permissions and duration required for its current task.
File System Structure
Directory Structure
Directories organize files in a hierarchical structure.
Unix/Linux Filesystem Hierarchy:
/ (root)
├── bin/ ← Essential binaries (ls, cp, mv)
├── sbin/ ← System binaries (fsck, init)
├── etc/ ← Configuration files
├── home/ ← User home directories
│ ├── user1/
│ └── user2/
├── var/ ← Variable data (logs, spool)
├── tmp/ ← Temporary files
├── usr/ ← User programs and data
│ ├── local/
│ └── share/
├── lib/ ← Libraries
├── proc/ ← Virtual filesystem (process info)
├── dev/ ← Device files
└── mnt/ ← Mount points for external drives
File Permissions (Unix)
-rwxr-xr-- 1 owner group size date filename
│└──┘└──┘└─┘
│ Owner Group Others
│ rwx r-x r--
│ 7 5 4 (Octal representation)
│
└── Type: - (file), d (directory), l (symlink), c (char device), b (block device)
Permission bits:
| Bit | Symbol | Value | Meaning |
|---|---|---|---|
| Read | r | 4 | View file contents |
| Write | w | 2 | Modify file contents |
| Execute | x | 1 | Execute as program |
chmod examples:
chmod 755 file.sh # rwxr-xr-x (owner all; group/others read+execute)
chmod 644 file.txt # rw-r--r-- (owner read+write; others read only)
chmod 700 secret/ # rwx------ (owner only)
Linux/Unix Commands Overview
Essential Linux Commands
# File and Directory Commands
ls # List directory contents
ls -la # Long format including hidden files
pwd # Print working directory
cd dir # Change directory
mkdir dir # Make directory
rm file # Remove file
rm -rf dir # Remove directory recursively
cp src dst # Copy file
mv src dst # Move/rename file
cat file # Display file contents
less file # Page through file
head -n 20 file # First 20 lines
tail -n 20 file # Last 20 lines
grep pattern file # Search for pattern
find / -name "*.log" # Find files by name
chmod 755 file # Change file permissions
chown user:group file # Change ownership
# Process Commands
ps aux # List all processes
top # Real-time process monitor
htop # Interactive process monitor
kill PID # Kill process by PID
kill -9 PID # Force kill
jobs # List background jobs
fg 1 # Bring job 1 to foreground
bg 1 # Send job 1 to background
sleep 10 & # Run in background
# System Information
uname -a # Kernel info
hostname # Show hostname
whoami # Current user
id # Current user/group IDs
uptime # System uptime and load
free -h # Memory usage
df -h # Disk space usage
du -sh dir # Directory disk usage
lscpu # CPU info
# Network Commands
ifconfig # Network interface info
ip addr # Modern network interface info
ping host # Test connectivity
netstat -an # Network connections
ss -tulpn # Socket statistics
curl url # Download from URL
wget url # Download file from URL
ssh user@host # Remote login
scp file user@host:path # Secure copy
# Package Management
# Debian/Ubuntu:
apt update
apt install package
apt remove package
# RedHat/CentOS:
yum install package
yum remove package
dnf install package
Types of Operating Systems
29.1 Batch Operating System
- Processes jobs in batches with no user interaction
- Similar jobs grouped together
Examples: IBM mainframes (JCL — Job Control Language)
- Advantages: Very efficient for large repetitive tasks
- Disadvantages: High turnaround time; hard to debug
29.2 Time-Sharing / Multitasking OS
- Multiple users share CPU time via time slicing
- Each user gets the illusion of dedicated access
- Examples: Unix, Linux, mainframe TSO
- Advantages: Fast response; multiple users
- Disadvantages: Complex synchronization
29.3 Distributed OS
- Processes distributed across multiple computers
- Appears as single system to user
Examples: Google's systems, Amoeba
- Advantages: High performance, fault tolerance
29.4 Real-Time OS (RTOS)
- Processes have strict timing deadlines
- Must respond within defined time limits
Hard RTOS: Missing deadline is catastrophic (aircraft, nuclear reactor)
- Soft RTOS: Degraded service if deadline missed (video streaming)
- Examples: VxWorks, FreeRTOS, RTEMS, QNX
- Use: Embedded systems, robotics, industrial control
29.5 Embedded OS
- Designed for embedded systems (microcontrollers, IoT)
- Small footprint, low power consumption
- Examples: Android (mobile), iOS, FreeRTOS, Embedded Linux
29.6 Network OS
- OS designed to support networks
- Examples: Windows Server, Ubuntu Server, CentOS
29.7 Mobile OS
- Designed for mobile devices
- Examples: Android (Linux kernel), iOS (BSD/Darwin kernel)
Continue learning
Related notes
Put this topic into timed practice
Open mock tests when you want full-exam pacing, or keep drilling in practice mode.