0% found this document useful (0 votes)
7 views3 pages

Practical 3 OS

This document outlines Practical 3 for Operating Systems, focusing on process management, system resources, and advanced file operations in a Unix/Linux environment. It includes commands for checking running processes, managing files and directories, changing file permissions and ownership, and monitoring system resources. The evaluation criteria emphasize correctness, understanding, and clarity in documentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Practical 3 OS

This document outlines Practical 3 for Operating Systems, focusing on process management, system resources, and advanced file operations in a Unix/Linux environment. It includes commands for checking running processes, managing files and directories, changing file permissions and ownership, and monitoring system resources. The evaluation criteria emphasize correctness, understanding, and clarity in documentation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Operating Systems

Practical 3

Practical 3: Working with Processes, System Resources, and Advanced File Operations

Objective:

To enhance the understanding of process management, system resources, and advanced file
operations in a Unix/Linux environment.

Working with Processes

1. Check Running Processes:


Use the ps command to check the list of currently running processes on your system:

bash

ps aux

2. Find a Specific Process:


Use ps combined with grep to find a specific running process (for example, bash):

bash
ps aux | grep bash

3. Terminate a Process:
Use kill to terminate a running process by its PID (Process ID). First, use ps to find the
PID, then kill it:

bash
kill <PID>

Example:

bash
kill 1234

4. Run a Process in the Background:


Start a long-running process in the background (e.g., a sleep command) and then check
the running jobs with jobs:

bash
sleep 100 &
jobs

Working with Files and Directories


1. Copy a File to Another Directory:
Use the cp command to copy a file to a new directory. First, create a directory and then
copy a file into it:

bash
mkdir second_practical
cp example.txt second_practical/

2. Move a File to Another Directory:


Use mv to move a file to another directory. For example, move example.txt to the
directory second_practical:

bash
mv example.txt second_practical/

3. Create a Directory Structure:


Use mkdir -p to create a nested directory structure in one go:

bash
mkdir -p parent_dir/child_dir/inner_dir

4. Search for a File in the File System:


Use the find command to search for a file named example.txt starting from the root
directory:

bash
find / -name example.txt

File Permission and Ownership

1. Change File Permissions:


Use chmod to change file permissions. Grant read, write, and execute permissions to the
owner of example.txt:

bash
chmod u+rwx example.txt

2. Change Ownership of a File:


Use chown to change the ownership of the file example.txt to another user:

bash

sudo chown new_user:new_group example.txt

3. Check the Current Permissions and Ownership:


Use ls -l to check the permissions, ownership, and group of example.txt:

bash
ls -l example.txt

System Resource Monitoring


1. Monitor CPU and Memory Usage:
Use top or htop to monitor system resources (CPU and memory usage):

bash
top

2. Disk Usage Information:


Use df -h to display disk usage information in human-readable format:

bash
df -h

3. Check Available Memory:


Use free -h to display the current available memory:

bash
free -h

4. Check System Uptime:


Use uptime to check how long the system has been running:

bash

uptime

Evaluation Criteria:

1. Correctness of command usage and outputs.


2. Understanding of file permissions, process management, and resource monitoring.
3. Clarity and structure of the report and documentation.

Tools and Environment:

 Unix/Linux environment (e.g., Ubuntu, CentOS, macOS)


 Terminal or command-line interface (CLI)

You might also like