- Working at the Command Line
- Processing Text
- Basic File Management
- Copying and Moving
- Standard Output and Input
- Working with Processes
- Changing Priorities
- Working with grep and sed
- Working with vi
- Lab Exercise 3-1: Starting and Stopping a Service
- Metacharacter Summary
- Command Summary
Lab Exercise 3-1: Starting and Stopping a Service
In this exercise, you will start a service, and then kill it.
Complete the following steps:
To start the yes service and have it output to a file in the background, type the following:
This starts the service and directs it to the file /dev/null. The "&" tells the system to put the process in the background. This also returns the PID (process ID number).
To verify that the service is running, type the following:
This returns a list of the services running. Near the bottom of the list, you see the PID, and under the command column, you see yes.
At the prompt, type the following:
Verify that the process has been killed by typing the following:
Look for the PID in the list. If it is not there, it worked!
yes >/dev /null &
kill 9 [PID #]