- 论坛徽章:
- 0
|
Unix基础-学习笔记
S8. Process Control and Multitasking
Concept: The Unix kernel can keep track of many processes at once, dividing its time between the jobs submitted to it. Each process submitted to the kernel is given a unique process ID. In reality, it is running only one job at a time, but quickly switching between all of its ongoing tasks. The concept of switching is called process scheduling.
Viewing processes: ps (process status) for viewing the status of all the unfinished jobs that have been submitted to the kernel.
eg. # ps -ef
-e option causes ps to include all processes (indluding ones that do not belong to u), and –f option causes ps to give a long listing (include the process owner, the process ID, the ID of the parent process, processor utilization, the time of submission, the process’s terminal, the total time for the process, and the command that started the process.)
eg. Use ps and grep, in a pipeling to find all the processes owned by u.
# ps -ef | grep crystalos(here is your username)
Killing processes: Occasionally, u will find a need to terminate a process.
Kill [-options] process-ID
eg. To force termination of a job whose process ID is 111,enter:
# ps -9 111 |
|