You are on page 1of 4

Pilar Rolon

Ximena Gomez
Activity 1: processes & states

Goal:

Consult the states of a process, eliminate, block and activate as required.

Information:

Processes in Linux have various states from created, running, suspended to terminated.
Each state must be managed by the Kernel and for this it requires structures that allow
the manipulation and access to the data of each process.

Although creation will not be used in this lab, it is important to understand how a
process changes state and how it can be terminated if it is causing a problem with the
system.

Check with ps the processes in the system, identify PID and PPID. Now follow the next
steps.

1. Use the -ef options and locate the first process on the system, what number does
it have?
2. From that process, all others are created with fork(). Use the following commands
and consult with ps what happened:

cat > example &

Do the same thing 2 more times with different file names. Don't forget to use ps to
check the processes information and try to explain the function of “&”

1. Use the command Jobs. What is it for?

Jobs = shows the state of the last process

2. What does the fg command do?


Pilar Rolon
Ximena Gomez
fg = Send the last process made

3. How could I “activate” a particular process with fg?


4. Use the kill command followed by the number of PID of the second process you
had created. It was possible?

No, it is not possible, because is blocked, we can only apply this with “-9” and we did it
then.

5. What happens if you use kill -9 -1 (don't do it if you are root)

You give the Access to the kill function to kill/cancel all the process and take off
all the users.

6. Include a description of all the states of the processes listed . Use man kill.

Report

Prepare your report including

1. Meanning of PID, PPID and an example of the heirachy of processes (20%)

PID: Process ID,

PPID: Parent Process ID,

2. Information of all commands used (40%),

Cat>: crear a file with cat.

Cat>>: add content to a file.

Dir/>>: add a directory to the file.

More: execute slow.

Cat: the exit from a program to the exit of other.

Mkfire: create a pipe.


Pilar Rolon
Ximena Gomez
Cat: Put a program in background.

Jobs: show the files.

Fg: send to the last process.

Control Z : Suspend the process.

Control C : Cancel the process.

Control B: Terminate the process.

Stat : Search text

X: Process done.

ps- : Show the process status

ps -ef : show the active process

3. Dificulties and exciting parts (20%)

One of the difficulties was that we didn’t find the state process lines, and actually
we don’t completely understand the function of the commands

The exciting was the part of that we can get in contact with our classmates and
other users, we can send messages and that was funny.

4. States of a process have a special value in this activitie (20%), point 8, try to
explain every state that appeared in your list of processes in point 2.
Pilar Rolon
Ximena Gomez

Ss - It waits for an event to get completed and is a session leader


Ss+ - It waits for an event to get completed and is a session leader and is in the foreground
process group
S+ - It waits for an event to get completed and is in the foreground process group
R+ - It is running or in wait to run and is in the foreground process group
T+ - The process is stopped, is in the foreground process group

You might also like