Linux Learning Note Two

Source: Internet
Author: User

A process is the process by which a program entity runs, an independent unit of resource allocation and scheduling, or an execution activity of a program on a processing machine. Distinguish between processes and programs

1.0 program is a set of static instructions, and the process is a program of dynamic execution process, it has a lifetime, is the dynamic generation and extinction of the program can not apply for system resources, can not be scheduled by the system, and can not be run as a standalone unit, so it does not occupy the system running resources.
2.0 procedures and processes have no corresponding relationship.
Take a look at the Windows system's processes, threads



Process Properties
As with Windows systems, there are always many processes running on Linux, each with an identification number called the PID (process ID) to distinguish between different processes. The process also includes the owner ID, the process name, the process state, the parent process ID, and the run time, among others.
From the start of the Linux operating system, the first process after booting is INIT, its PID is 1,init is the only right system core directly running process, the new process can be generated by fork.
status of the process

Ready state: The process has acquired all the resources required to run outside the CPU.
Running state: Process consumes CPU running.
Wait state: A process is waiting for an event or a resource
Pending state: A running process that pauses to run because of a loss of CPU for one reason
Terminate status: Process has ended
Hibernate: Process actively temporarily stops running
Zombie state: The process has stopped running, but the associated control information is thrown on hold.


process priority: All processes in a Linux system form different queues in chronological order, depending on the state in which they are located. The priority range of a process is an integer between -20~19, and the lower the value, the higher the priority.
type of Process

1.0 system processes: After the operating system starts. The system environment platform runs the process that is loaded, it is not terminal or user associated * *
2.0 user processes: associated with a terminal, using a user ID, is a program executed by the user.
3.0 Daemon: No screen prompts, only in the background to wait for the user or system request, the majority of network multiuser system work through the daemon implementation.

Process Control Commands

ps [选项]-a 显示当前终端所有进程-A 显示系统所有进程,包括其它用户进程和系统进程信息u 显示包括进程拥有人在内的详细信息。

%CPU CPU Usage
%MEM Memory Utilization
The VSZ process occupies the size of virtual memory
Status of the STAT process

pstree [选项]-a 显示启动进程的命令行-n 按照进程号进行排序

Top real-time displays the status of the test process, including system information such as CPU utilization, memory utilization, process status, and so on.

kill [选项] PIDkill % 作业号终止正在运行的进程或者作业。-15 正常结束-9 强制终止进程-1 重新加载配置文件
nice -n 优先数  命令名在进程运行前,更改优先级renice 优先数 PID在进程运行中更改优先级

* * First in the blog park, updated so much, simple book markdown than the blog garden, can be compared, but blog Park to make with beautiful * *

Reference articles
Linux Kill Process Method Daquan (Kill,killall)
Linux KILL command Detailed
Linux process status and transition relationships

Linux Learning Note Two

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.