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

OSY5

OSY 22516 practical number 5

Uploaded by

omkokate555
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)
8 views3 pages

OSY5

OSY 22516 practical number 5

Uploaded by

omkokate555
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

Here’s a breakdown of the Linux process management commands (ps, wait, sleep, exit, and kill) with

their purpose, usage, and Windows equivalents:

1. ps

• Purpose: Displays information about active processes.

• Linux Command:

• ps

• ps aux

• ps -ef

(Shows a list of processes with various details.)

• Windows Equivalent:

• tasklist

(Lists all running processes.)

o For more detailed output, use PowerShell:

o Get-Process

2. wait

• Purpose: Pauses the execution of a script until a specified process finishes.

• Linux Command:

• wait PID

(Waits for the process with the specified PID to finish.)

• Windows Equivalent:

o PowerShell provides similar functionality:

o Start-Process notepad -Wait

(Waits until the notepad process ends before proceeding.)

3. sleep

• Purpose: Delays the execution of a command or script for a specified time.

• Linux Command:

• sleep 5

(Pauses execution for 5 seconds.)


• Windows Equivalent:

o In Command Prompt:

o timeout 5

(Pauses for 5 seconds.)

o In PowerShell:

o Start-Sleep -Seconds 5

4. exit

• Purpose: Terminates a shell session or script.

• Linux Command:

• exit

(Exits the shell or script with an optional status code.)

• Windows Equivalent:

• exit

(Closes the Command Prompt or PowerShell session.)

5. kill

• Purpose: Sends a signal to a process to terminate it (or perform other actions).

• Linux Command:

• kill PID

• kill -9 PID

(Terminates the process with the given PID. -9 forces the termination.)

• Windows Equivalent:

o Using Command Prompt:

o taskkill /PID PID

o taskkill /F /PID PID

(The /F flag forces the termination.)

o Using PowerShell:

o Stop-Process -Id PID

Summary of Equivalents:
Linux Command Windows Command Windows PowerShell

ps tasklist Get-Process

wait No direct equivalent Start-Process -Wait

sleep timeout Start-Sleep

exit exit exit

kill taskkill Stop-Process

Let me know if you'd like further examples or explanations!

You might also like