Bash three methods for judging the existence of a process

Source: Internet
Author: User
Article Title: bash three methods for judging the existence of a process. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Processes in the current system:
Apple @ ubuntu :~ $ Ps-ef
UID PID PPID C STIME TTY TIME CMD
Root 1 0 0 13:57? 00:00:02/sbin/init
Root 2 0 0 13:57? 00:00:00 [kthreadd]
Root 3 2 0 13:57? 00:00:00 [migration/0]
Root 4 2 0 13:57? 00:00:00 [ksoftirqd/0]
Root 5 2 0 13:57? 00:00:00 [watchdog/0]
Root 6 2 0 13:57? 00:00:00 [migration/1]
Root 7 2 0 13:57? 00:00:00 [ksoftirqd/1]
Root 8 2 0 13:57? 00:00:00 [watchdog/1]
Root 9 2 0 13:57? 00:00:00 [events/0]
Root 10 2 0 13:57? 00:00:00 [events/1]
Root 11 2 0 13:57? 00:00:00 [khelper]
Root 12 2 0 13:57? 00:00:00 [kstop/0]
Root 13 2 0 :57? 00:00:00 [kstop/1]
Root 14 2 0 13:57? 00:00:00 [kintegrityd/0]
Root 15 2 0 13:57? 00:00:00 [kintegrityd/1]
Root 16 2 0 13:57? 00:00:00 [kblockd/0]
Root 17 2 0 13:57? 00:00:00 [kblockd/1]
Root 18 2 0 13:57? 00:00:00 [kacpid]
Root 19 2 0 13:57? 00:00:00 [kacpi_notify]
Root 20 2 0 13:57? 00:00:00 [cqueue]
Root 21 2 0 13:57? 00:00:00 [ata/0]
Root 22 2 0 13:57? 00:00:00 [ata/1]
Root 23 2 0 13:57? 00:00:00 [ata_aux]
Root 24 2 0 13:57? 00:00:00 [ksuspend_usbd]
Root 25 2 0 13:57? 00:00:00 [khubd]
Root 26 2 0 13:57? 00:00:00 [kseriod]
Root 27 2 0 13:57? 00:00:00 [kmmcd]
Root 28 2 0 13:57? 00:00:00 [btaddconn]
Root 29 2 0 13:57? 00:00:00 [btdelconn]
Root 30 2 0 13:57? 00:00:00 [pdflush]
Root 31 2 0 13:57? 00:00:00 [pdflush]
Root 32 2 0 13:57? 00:00:00 [kswapd0]
Root 33 2 0 13:57? 00:00:00 [aio/0]
Root 34 2 0 :57? 00:00:00 [aio/1]
Root 35 2 0 13:57? 00:00:00 [ecryptfs-kthrea]
Root 38 2 0 13:57? 00:00:00 [pciehpd]
Root 39 2 0 13:57? 00:00:00 [scsi_eh_0]
Root 40 2 0 13:57? 00:00:00 [scsi_eh_1]
Root 41 2 0 :57? 00:00:00 [kstriped]
Root 42 2 0 13:57? 00:00:00 [kmpathd/0]
Root 43 2 0 :57? 00:00:00 [kmpathd/1]
Root 44 2 0 :57? 00:00:00 [kmpath_handlerd]
Root 45 2 0 13:57? 00:00:00 [ksnapd]
Root 46 2 0 13:57? 00:00:00 [kondemand/0]
Root 47 2 0 13:57? 00:00:00 [kondemand/1]
Root 48 2 0 13:57? 00:00:00 [krfcommd]
Root 256 2 0? 00:00:00 [mpt_poll_0]
Root 717 2 0? 00:00:00 [scsi_eh_2]
Root 753 2 0? 00:00:00 [kdmflush]
Root 764 2 0? 00:00:00 [kdmflush]
Root 795 2 0? 00:00:00 [kjournald]
Root 915 1 0? 00:00:00/sbin/udevd -- daemon
Root 1617 2 0? 00:00:00 [kpsmoused]
Root 2166 1 0 00:00:00 tty4/sbin/getty 38400 tty4
Root 2167 1 0 00:00:00 tty5/sbin/getty 38400 tty5
Root 2172 1 0 00:00:00 tty2/sbin/getty 38400 tty2
Root 2173 1 0 00:00:00 tty3/sbin/getty 38400 tty3
Root 2174 1 0 00:00:00 tty6/sbin/getty 38400 tty6
Root 2244 1 0? 00:00:00/usr/sbin/acpid-c/etc/acpi/eve
Root 2259 1 0? 00:00:00/usr/sbin/syslog-ng-p/var/run/
105 2279 1 0? 00:00:00/bin/Alibaba-daemon -- system
Root 2311 1 0? 00:00:00/usr/sbin/incrond-f/etc/incron
Root 2381 1 0? 00:00:00 dhclient3-e IF_METRIC = 100-pf/
Root 2442 1 0? 00:00:00/usr/sbin/sshd
Root 2453 1 0? 00:00:00/usr/lib/postfix/master
Postfix 2465 2453 0? 00:00:00 pickup-l-t fifo-u-c
Postfix 2468 2453 0? 00:00:00 qmgr-l-t fifo-u
108 2472 1 0? 00:00:00/usr/sbin/hald
Root 2475 1 0? 00:00:00/usr/sbin/console-kit-daemon
Root 2538 2472 0? 00:00:00 hald-runner
Root 2567 2538 0? 00:00:00 hald-addon-input: Listening on/
Root 2594 2538 0? 00:00:00 hald-addon-storage: polling/dev
Root 2595 2538 0? 00:00:00 hald-addon-storage: no polling o
108 2600 2538 0? 00:00:00 hald-addon-acpi: listening on ac.
Daemon 2647 1 0 13:58? 00:00:00/usr/sbin/atd
Root 2672 1 0? 00:00:00/usr/sbin/cron
Root 2691 1 0 00:00:00 tty1/sbin/getty 38400 tty1
Root 2994 2442 0? 00:00:00 sshd: apple [priv]
Apple 3003 2994 0? 00:00:00 sshd: apple @ pts/0
Apple 3004 3003 1 00:00:00 pts/0-bash
Apple 3024 3004 0 00:00:00 pts/0 ps-ef

[1] [2] Next page

Related Article

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.