# NSCI 580A3 fall 2017

### Sidebar

NSCI 580A3

Instructors
Tai Montgomery
Erin Nishimura

wiki:2016processes

# PROCESSES

The shell keeps track of every process. These are commands and executed programs that are running. Most of our commands and programs up to this point have had fast turn around time. This is not always going to be the case in computational biology. It is useful to know how to keep track of running processes and terminate them when they take too long or misbehave.

## View processes with ps

View any running processes using ps

$ps Exercise: 1. Open a second terminal. 2. Navigate to the same directory that contains hello_user.sh. 3. Execute ./hello_user.sh in the second terminal. Do not enter your name. 4. In the first terminal, execute ps. ## Terminate processes Let's say we want to terminate a program that we started. This is often necessary to do when we change our mind or the program is doing something wrong. Exercise: Terminate a process with CTRL + C $./hello_user.sh #start the hello_user.sh program. Don't give it your name
$CTRL+C # Hold down both the control key and 'C' key at once Exercise: Terminate a process using kill: In ONE terminal: $./hello_user.sh #start the hello_user.sh program. Don't give it your name

In the SECOND terminal:

$ps$kill <pID number>