_DAY_2_TASKS

> Initiating linux_lab_challenges.exe...

🐧 TASK 1: Basic Navigation

Level: Beginner

Objective: Understand directory navigation and listing files.

# Example Demonstration
$cd ~
$mkdir Practice
$cd Practice
$pwd

Student Task

  • Go to root directory (`/`).
  • Return to your home directory (`~`).
  • Create folder named LinuxLab.
  • Enter LinuxLab.
  • Display all files including hidden files (`ls -a`).

📝 TASK 2: File Creation & Editing

Level: Beginner → Basic

Objective: Create and edit files using the terminal.

# Example Demonstration
$touch test.txt
$echo "This is Linux Day 2" > test.txt
$cat test.txt

Student Task

  • Create file named info.txt.
  • Write: "Linux commands are powerful" into it.
  • Append another line: "Practice makes perfect" (Hint: `>>`).
  • Display file content.

📂 TASK 3: File Management

Level: Basic → Intermediate

Objective: Copy, move, and rename files.

# Example Demonstration
$mkdir Data
$cp test.txt Data/
$mv Data/test.txt Data/backup.txt
$mv Data/backup.txt ~/

Student Task

  • Create folder named Projects.
  • Inside it create file project1.txt.
  • Copy project1.txt to home directory.
  • Rename copied file to final_project.txt.
  • Delete the original file inside Projects.

🔐 TASK 4: Permissions

Level: Intermediate

Objective: Understand and modify file permissions.

# Example Demonstration
$touch script.sh
$ls -l script.sh
$chmod +x script.sh
$chmod 700 script.sh
# 700: Owner=rwx (7), Group=--- (0), Others=--- (0)

Student Task

  • Create file secure.txt.
  • Give read & write permission only to owner (6).
  • Remove all permissions from group and others (0 0).
  • Verify using `ls -l`. Expected: `-rw-------`.

📊 TASK 5: Process Monitoring

Level: Medium

Objective: Understand system processes and resource usage.

# Example Demonstration
$top # View processes (q to exit)
$free -h # Memory usage
$df -h # Disk usage
$clear

Student Task

  • Run `top` and identify the process with highest CPU usage.
  • Check how much RAM is free on your system.
  • Check how much space is left on your main disk (`/`).
  • Clear your terminal screen.

🔍 TASK 6: File Search & Content Filtering

Level: Medium

Objective: Search inside files and filter data using grep.

# Example Demonstration
$grep "Linux" data.txt # Find lines with "Linux"
$grep -c "Linux" data.txt # Count occurrences

Student Task

  • Create file tech.txt with 5 lines of hardware/software words.
  • Search for the word "server".
  • Count how many times "server" appears (`grep -c`).
  • Display only lines that do NOT contain "server" (`grep -v`).

💾 TASK 7: Disk Usage Investigation

Level: Medium

Objective: Analyze which files/folders consume storage.

# Example Demonstration
$ls -lh # List files with human-readable sizes
$du -sh * # Check size of all folders

Student Task

  • Create 3 files of different sizes using `dd` or `touch`.
  • Check disk usage of each file.
  • Identify which file uses maximum space.
  • Delete the largest file.

⚡ TASK 8: Process Control

Level: Medium → Advanced

Objective: Manage background processes and kill unwanted tasks.

# Example Demonstration
$sleep 300 & # Run in background (&)
$ps # Find PID
$kill 1234 # Replace 1234 with actual PID

Student Task

  • Run 2 background sleep processes (`sleep 300 &`).
  • Identify both PIDs using `ps` or `jobs -l`.
  • Kill only one process.
  • Verify the other one is still running.

👤 TASK 9: User & Permission Engineering

Level: Advanced

Objective: User isolation and advanced permission security.

# Example Demonstration
$sudo adduser testuser
$chmod 600 secure.txt # Owner rw only

Student Task

  • Create user named labadmin (`sudo adduser labadmin`).
  • Create file project.txt inside home.
  • Set permissions: Owner full (7), Group read (4), Others none (0).
  • Verify using `ls -l`. Expected permissions: `740` (rwxr-----).
  • Delete user after completion.

📜 TASK 10: Bash Automation Script

Level: Advanced

Objective: Create a system information script.

# Example using nano or vim
$nano report.sh
#!/bin/bash
echo "System Report"
date
uptime
$chmod +x report.sh
$./report.sh

Student Task

  • Create a script named sys_check.sh.
  • It should print system date, current user (`whoami`), and free memory.
  • Make it executable.
  • Run the script and verify output.

> All tasks completed?

Return to Dashboard