NEW BRUNSWICK COMPUTING SERVICES
USER SERVICES GROUP

Intermediate Of The UNIX Operating System
Exercise 2

Working with Processes

This lab demonstrates the use of ps to list processes, and kill to end them.

  1. Execute the ps command with no options. This shows the processes running in the current login session. List your processes below.

    Re-enter any extra processes you may be running (except tcsh) and end them before proceeding.

  2. Run the following commands; once the ls starts, use <CTRL>c to terminate it:

    cd ~ ; ls -lR ..

  3. Run the process again, but this time put it in the background with &:

    ls -lR .. &

    Since you put it in the background you might think that you would get your prompt back and be able to type in more commands at the terminal. Describe what actually happened below.


    Type a % followed by a carriage return to bring the above to the foreground then a <CTRL>C to terminate it.

  4. Use the cd command to go to the UNXclass subdirectory.

  5. Type the command:

    emacs big.file &

    then run "ps" to get the PID of the emacs process. Use the PID for the emacs session to kill it.
    What command did you use?
    If the emacs session's job number was 1, what other command would have killed it?

After attempting the above look here for answers

End of Practice 2 - Working with Processes