UNIX System Management: Process Control

Source: Internet
Author: User
Keywords UNIX System Management Process Control
Tags control example exit information it is monitor process process control

To complete this chapter, you can do the following things:

Using the PS command

Run the process in the background and use the PS command to monitor the status of the running process

Run a background process and make it not hang until you exit the system.

Toggles the background process to run to the foreground.

Suspends a process.

Stops the process from running.

1 PS Command

Syntax:

PS [-EFL] reports the status of the process

Example:

$ ps

PID TTY Time COMMAND

1324 TTYP2 0:00 SH

1387 TTYP2 0:00 PS

$ ps–ef

UID PID PPID C stime TTY time COMMAND

Root 0 0 0, 1? 0:20 Swapper

Root 1 0 0, 23? 0:00 Init

Root 2 0 0, 23? 0:16 Vhand

User3 1324 1 3 18:03:21 ttyp2 0:00-sh

User3 1390 1324 18:30:23 ttyp2 0:00

Each process in the system is assigned a unique number when it is started, which is called the process ID (PID). The PS command displays information about processes currently running (or sleeping), including the PID of each process and the PID (PPID) of each process parent process. With the PID and ppid numbers, you can trace the origins of any process in your system. The PS command also reports which terminal the owner and process of each process are executing on.

PS commands can be executed without parameters, and results will report the process information of your current terminal session thread. The-e option reports information about each process in the system, not just the process information you run yourself. The-F and-L Options report lengthy (long) or complete (full) lists that contain other details.

Note: When the PS command is executed, the CPU is concentrated, and you may have noticed that the command will be executed in a few moments before it is answered.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.