How does one view the ID of the current process in Linux?

Source: Internet
Author: User

How does one view the ID of the current process in Linux?

How does one view the ID of the current process in Linux?

$ Indicates the ID of the current process, and $ PPID indicates the ID of the parent process of the current process.

Bash-3.2 $ echo $
13750
Bash-3.2 $ echo $ PPID
13656
Bash-3.2 $ ps-ef | grep 13750
Oracle 13750 13656 0 00:00:00 pts/4 bash
Oracle 28981 13750 0 00:00:00 pts/4 ps-ef
Oracle 28982 13750 0 00:00:00 pts/4 grep 13750
The above result indicates that the parent process of ps (pid = 28981) and grep (pid = 28982) is bash (pid = 13750 ).

By the way, who is the parent process of bash? -Ksh: bash is run at the ksh prompt.
Bash-3.2 $ ps 13656
PID TTY STAT TIME COMMAND
13656 pts/4 S-ksh

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.