OPS102 - Week 5 - ProcessManagement
.docx
keyboard_arrow_up
School
Seneca College *
*We aren’t endorsed by this school
Course
102
Subject
Information Systems
Date
Feb 20, 2024
Type
docx
Pages
16
Uploaded by UltraStraw12009
OPS102 – Week 5 – Process Management - Sample Lab
Student Name: Md Tahmid Kabir Sowdagor
Student ID: 168400224
Introduction
Both Linux and Windows, as powerful operating systems, provides robust process management
capabilities. Understanding how to manage processes is crucial for effectively utilizing the operating system. A process refers to an executing program or task, whether it is a system service, a user application, or a background utility.
Here are some fundamental concepts related to process management:
Processes and Process IDs (PIDs):
Every process in Linux or Windows is assigned a unique identifier called a Process ID (PID). PIDs enable the system to track and manage processes effectively. You can view the PIDs of running processes using various commands and utilities.
Process States
: Processes can be in different states, such as running, sleeping, stopped, or terminated. Understanding these states helps in monitoring and controlling processes
effectively. Commands like ps and top provide insights into process states.
Process Ownership
: Each process is associated with an owner, typically the user who initiated or owns the process. Process ownership is essential for managing permissions and access control.
Process Hierarchy
: processes follow a hierarchical structure. A process can create child processes, and those child processes can, in turn, spawn their own subprocesses. This hierarchical arrangement helps organize and manage related processes.
Process Control
: Linux provides various commands and tools to control processes. You can start, stop, pause, resume, or terminate processes using commands like kill, killall, pkill, and signals such as SIGSTOP and SIGCONT. Windows offers multiple methods to control processes. The Task Manager, a built-in Windows utility, allows you to view and manage running processes. It enables you to end processes, change process priorities, and analyze resource usage.
F
oreground and Background Processes
: Both Linux and windows allow executing processes either in the foreground or background. Foreground processes run directly in
the terminal, while background processes operate independently, freeing up the terminal for other tasks. You can switch between foreground and background using commands like &, fg, and bg commands in Linux. In windows, Task Manager and PowerShell provide options to manage processes in both modes.
Process Monitoring and Resource Usage
: Monitoring the performance and resource usage of processes is essential for system administrators. In Linux, tools like top, htop, and ps provide real-time information on CPU usage, memory consumption, and other vital statistics. In Windows, Task Manager provides real-time information on CPU usage, memory consumption, disk activity, and network utilization. Performance Monitor (PerfMon) is a powerful tool for in-depth process monitoring.
Activity 1: Monitoring Linux Processes with ps command
Perform the following steps:
1.
Make certain that you are logged into your Matrix account
2.
Issue a Linux command to confirm that you are located in your home
directory.
3.
The ps
_ command provides a list of processes that are running, or at least that were running at the time the command was called. Run the command ps
in your terminal
4.
What output you see, take a screenshot and paste below.
I can see the process id number and the running time.
5.
How many processes are currently running? What information is displayed for each process? Answer below.
2 processes are currently running.
The PID shows the unique process ID number. The TTY shows the terminal associated with each process.
Time shows the process timing.
The CMD shows the name or command that initiated the process.
6.
Use the ps command with the ‘-e’ option to display information about all processes in the system. Run the command ps -e
7.
Analyze the output and identify the running processes on your system. Note the PID, TTY, and CMD columns. What do these column mean?
PID = Process ID
This column represents the unique identifier for each running process.
TTY = Terminal
The TTY column shows the terminal associated with each process.
TIME
This column displays the amount of CPU time that each process has consumed since it started.
CMD = Command
The CMD column shows the name or command that initiated the process.
8.
Use the 'ps' command with the '-f' option to display a full-format listing of the processes. Run the command ps -f
9.
Examine the output, which provides detailed information about each process, including UID, PID, PPID, CPU%, MEM%, START, and CMD
UID = User ID This column shows the user who owns or started the process.
PID = Process ID
This column represents the unique identifier for each running process.
PPID = Parent Process ID
This column indicates the PID of the parent process that spawned or created the current process.
C = CPU%
This column shows the CPU usage of the process as a percentage.
STIME = Start Time
This column displays the start time of the process.
TTY = Terminal
The TTY column shows the terminal associated with each process.
TIME
This column displays the amount of CPU time that each process has consumed since it started.
CMD = Command
The CMD column shows the name or command that initiated the process.
10.
Use the 'ps' command with the '-l' option to display a long listing format of processes. Execute the following command: ps -l
11.
Analyze the output and observe the columns displayed, including F, S, UID, PID, PPID, PRI, NI, ADDR, SZ, RSS, WCHAN, STAT, TTY, TIME, and CMD.
F = Flags This column provides information about the process state and flags.
S in the first process indicates that it is sleeping or waiting.
UID = User ID This column shows the user who owns or started the process.
PID = Process ID
This column represents the unique identifier for each running process.
PPID = Parent Process ID
This column indicates the PID of the parent process that spawned or created the current
PRI = Priority This column shows the priority of the process.
NI = Nice Value
This column indicates the value of the process.
ADDR = Address This column provides the kernel text address where the process is located.
SZ = Size
This column displays the size of the process in physical pages.
RSS = Resident Set Size
This column represents the resident set size, which is the portion of a process's memory that is held in RAM.
RSS = Resident Set Size
This column represents the resident set size, which is the portion of a process's memory that is held in RAM.
STAT = Status This column provides a combination of process status codes
TTY = Terminal
The TTY column shows the terminal associated with each process.
TIME
This column displays the amount of CPU time that each process has consumed since it started.
CMD = Command
The CMD column shows the name or command that initiated the process.
12.
Use the '
-u
' option followed by a username to display processes owned by that user.
13.
Use the '
-p
' option followed by a process ID (PID) to display information about a specific process.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help