OS Practical Exam Case Study
OS Practical Exam Case Study
A team of developers shares a Linux server for code deployment and debugging. Each
developer uses the terminal for various tasks including checking system status, writing scripts,
and managing files.
echo Used in shell scripts or to display output, e.g., echo "Build started at
$(date)".
clear Clears the cluttered terminal screen during debugging or long sessions.
exit Used to log out from the terminal or end a shell script execution.
time Measures how long a command or script takes to execute, e.g., time
./build.sh.
uptime Checks how long the server has been running—useful for troubleshooting
crashes.
cal Checks the calendar, useful when scheduling scripts or meetings via terminal.
tty Tells which terminal you're connected to, helpful in debugging user sessions.
man Accesses the manual page for a command, e.g., man grep to see syntax and
options.
which Finds the location of installed utilities, e.g., which python shows Python
binary path.
history Views recently executed commands for repeating or debugging past
commands.
pwd Displays the present working directory; helps users verify their path.
A system admin in a university lab environment is responsible for maintaining Linux machines
used by students for assignments, printing reports, and sending lab notifications via email.
lpstat Checks the status of current print jobs and printer queues.
Scenario:
Implementation Steps:
These case studies provide practical usage of user and file management commands in
real-world scenarios. Let me know if you need further details!
Scenario:
A university has a shared Linux server for students and faculty to access programming
resources. The system administrator needs to create user accounts, manage permissions, and
ensure security.
Implementation Steps:
kill You want to terminate a process using its PID. kill 1234
pkill You want to kill a process by its name (not PID). pkill firefox
xkill A graphical app is frozen and you want to xkill (then click on
forcefully kill it by clicking on its window. the window)
A software development company is running multiple apps (e.g., Python scripts, MySQL
server, Firefox for testing) on a Linux server. Some scripts consume a lot of CPU,
causing the system to slow down. The team needs to monitor and manage these
processes efficiently.
Objectives:
bash
CopyEdit
xkill
✅ Conclusion:
This case study shows how a Linux admin can use process management commands
to:
A company runs a web server that has been responding slowly. The system
administrator is assigned the task of diagnosing whether it's a memory issue or a disk
usage problem.
Command:
bash
CopyEdit
free -h
●
● Use: Displays free, used, and total memory (RAM and swap) in a
human-readable format.
● Solution: If free shows low "available" RAM and high swap usage, it indicates
memory pressure.
Command:
bash
CopyEdit
cat /proc/meminfo
●
● Use: Dumps detailed memory stats directly from the kernel.
Command:
bash
CopyEdit
top
●
● Use: Lists running processes sorted by CPU/memory usage.
Alternative Command:
bash
CopyEdit
htop
●
● Use: Colorful, interactive version of top.
● Note: May need to install it using sudo apt install htop.
Command:
bash
CopyEdit
df -h
●
● Use: Displays disk space usage for all mounted partitions.
Command:
bash
CopyEdit
du -sh /var/*
●
● Use: Displays size of folders under /var.
Command:
bash
CopyEdit
vmstat 5
●
● Use: Displays memory, CPU, and I/O usage every 5 seconds.
Command:
bash
CopyEdit
sudo dmidecode -t memory
●
● Use: Provides hardware-level details of memory modules.
Command:
bash
CopyEdit
getconf PAGE_SIZE
●
● Output: Shows memory page size (e.g., 4096 bytes).
Command:
bash
CopyEdit
sar -r 1 5
●
● Use: Reports memory usage (free, used, cache, buffer) at 1-second intervals, 5
times.
Commands Used:
Solution Taken:
✅ Conclusion:
These commands together provide a comprehensive diagnostic toolkit for identifying,
analyzing, and resolving memory-related issues on Unix/Linux systems.