Objective: Understand directory navigation and listing files.
$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`).
Objective: Create and edit files using the terminal.
$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.
Objective: Copy, move, and rename files.
$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.
Objective: Understand and modify file permissions.
$touch script.sh
$ls -l script.sh
$chmod +x script.sh
$chmod 700 script.sh
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-------`.
Objective: Understand system processes and resource usage.
$top
$free -h
$df -h
$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.
Objective: Search inside files and filter data using
grep.
$grep "Linux" data.txt
$grep -c "Linux" data.txt
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`).
Objective: Analyze which files/folders consume storage.
$ls -lh
$du -sh *
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.
Objective: Manage background processes and kill unwanted tasks.
$sleep 300 &
$ps
$kill 1234
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.
Objective: User isolation and advanced permission security.
$sudo adduser testuser
$chmod 600 secure.txt
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.
Objective: Create a system information script.
$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.