208k views
4 votes
Unix, List commands that will perform following tasks.

1. Do the following, in order:
a) Show all current running processes that belong to
you.
b) Show the jobs currently running (there should not be any)
c) Start a sleep 500 command in the foreground
d) Send the sleep 500 command to the background (you get your prompt back)
e) Show the jobs currently running (you should see the sleep job)
f) Bring the sleep 500 back into the foreground (you no longer have your prompt)
g) Kill the sleep job

User Mororo
by
8.1k points

1 Answer

7 votes

Final answer:

The Unix commands to perform the mentioned tasks are: ps -u your_username, jobs, sleep 500, sleep 500 &, jobs, fg %job_id, and kill %job_id.

Step-by-step explanation:

Unix Commands for Performing Tasks

a) Show all current running processes that belong to you:

ps -u your_username

b) Show the jobs currently running:

jobs

c) Start a sleep 500 command in the foreground:

sleep 500

d) Send the sleep 500 command to the background:

sleep 500 &

e) Show the jobs currently running:

jobs

f) Bring the sleep 500 back into the foreground:

fg %job_id

g) Kill the sleep job:

kill %job_id

User Tohuwawohu
by
8.3k points