What does linux ppid mean?

Apr 12, 2022 pm 05:31 PM
linux

In Linux, ppid refers to the PID of the parent process, that is, the process ID number of the parent process. When a process is created, the process that created it is called the parent process, and the child process uses the PPID to indicate who is its parent process; you can execute the "ps -ef | grep process name" command to view it, and the third column of the output result It is the ppid value.

What does linux ppid mean?

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

A process contains multiple attribute parameters. By using the ps command, we can view detailed information about the process in the current system, for example:

[root@localhost ~]# ps -le
F S UID PID PPID C  PRI  NI ADDR SZ   WCHAN TTY     TIMECMD
4 S 0   1   0    0  80   0  -    718    -   ?     00:00:02 init
1 S 0   2   0    0  80   0  -    0      -   ?     00:00:00 kthreadd
…省略部分输出…
Copy after login

You can see that each process contains F , S, UID, PID and other attributes. These attribute parameters determine the order in which processes are processed, the resources that can be accessed, etc., and are very important to both system administrators and programmers.

The following article will introduce to you common attribute parameters such as UID, PID, PPID.

UID (real user ID)

UID The abbreviation of User Identification. After a UID user registers, the system will automatically give you a UID value. It means to give this user a number.

Only the creator of the process and the root user have the right to operate the process, so it is very necessary to record the creator (that is, the owner) of a process. The UID of a process is the user ID number of its creator, which is used to identify the owner of the process.

EUID (Effective User ID)

In addition to UID, Linux also saves an "effective user ID number" for the process, called EUID. This special UID number is used to determine a process's access rights to certain resources and files. In most cases, the UID and EUID of a process are the same, except for the famous setuid program.

So, what is a setuid program? We talked about the passwd command earlier. This command allows users to modify their login password. But have readers considered this issue? The password is stored in the /etc/shadow file. This file is not readable by ordinary users. So why can users change their passwords by modifying the shadow file?

This is the beauty of setuid. By giving passwd the permissions of the file owner (that is, root) during the execution phase, the user can temporarily have the ability to modify the shadow file (of course, this ability is limited) of). Therefore, passwd is a typical setuid program, whose UID is the user ID currently executing this command, and EUID is the ID of the root user (that is, 0).

PID (Process ID number)

The system assigns each user an ID number (UID) that identifies their identity. Similarly, a process also has such an ID number, which is called PID (Process Identification).

You must know that using ID to determine the process is very beneficial, because for computers, it is always more convenient to recognize numbers than to recognize a string of characters. Linux does not need to understand those that are very "useful" to humans. Meaning" of the process name.

Not only does Linux itself use PID to determine the process, but it also requires users to provide the corresponding PID number when managing the process. In fact, almost all process management tools accept PID numbers instead of process names.

PPID (PID of parent process)

In Linux, all processes must be created by another process (except when the system boots, which is created autonomously by the kernel) and those processes installed). When a process is created, the process that created it is called the parent process, and the process is called the child process.

The child process uses PPID to indicate who is its "father". It is easy to understand that PPID refers to the PID of its parent process.

Note that in the above description, the word "create" is used many times. This is for convenience of expression and understanding. In fact, in Linux, processes cannot be created "out of thin air" , In other words, Linux does not provide a system call to allow applications to "create" a process. Applications can only spawn new processes by cloning themselves.

Explanation:

PID and PPID are both non-zero integers.

PID is unique, and a PID only identifies one process.

Another new process created by one process is called a child process. Conversely, the process that creates the child process is called the parent process.

For an ordinary user process, its parent process is the Shell that executes it. For Linux, the Shell is bash.

Linux method to view the PID and PPID of the process

What does linux ppid mean?

#Example: View the PID number of the nginx process,ps -ef | grep nginx

What does linux ppid mean?

After execution, the PID and PPID number of the process can be returned

What does linux ppid mean?

Command uses extension to force end a process

What does linux ppid mean?

Example, forcefully end the nginx process

What does linux ppid mean?

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What does linux ppid mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to view the docker process How to view the docker process Apr 15, 2025 am 11:48 AM

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

What is vscode What is vscode for? What is vscode What is vscode for? Apr 15, 2025 pm 06:45 PM

VS Code is the full name Visual Studio Code, which is a free and open source cross-platform code editor and development environment developed by Microsoft. It supports a wide range of programming languages ​​and provides syntax highlighting, code automatic completion, code snippets and smart prompts to improve development efficiency. Through a rich extension ecosystem, users can add extensions to specific needs and languages, such as debuggers, code formatting tools, and Git integrations. VS Code also includes an intuitive debugger that helps quickly find and resolve bugs in your code.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

See all articles