Linux under PS command

Source: Internet
Author: User

Brief Introduction

The PS command in Linux is the abbreviation for process status. The PS command is used to list those processes that are currently running on the system. The PS command lists the current snapshots of those processes, which are the processes that are executing the PS command at the moment, dynamically displaying process information, and using the top command.

This command determines which processes are running and running, whether the process is complete, if the process is dead, which processes are consuming excessive resources, and so on. PS provides a one-time view of the process and provides a view of the results that are not dynamically contiguous. If you want to monitor process time, you should use the top tool. The Kill command is used to kill the process.

There are 5 states of processes on Linux:

    1. Running (running or waiting in the running queue)
    2. Interrupt (dormant, blocked, waiting for a condition to form or receive a signal)
    3. Non-interruptible (Received signal does not wake up and cannot be run, process must wait until interrupt occurs)
    4. Zombie (The process has been terminated, but the process descriptor exists until the parent process calls WAIT4 () after the system call is released)
    5. Stop (process received Sigstop, SIGSTP, Sigtin, Sigtou signal after stop running)
1. Command Format

ps[parameters]

2. Command function

Used to display the status of the current process

3. Command Parameters

A Show All Processes

-a displays all programs under the same terminal

-A Show All processes

C Displays the real name of the process

-N Reverse Selection

-e equals "-A"

e Display Environment variables

F show the relationship between programs

-H Display tree structure

R shows the process of the current terminal

T displays all programs for the current terminal

U specify all processes for the user

-au Show more detailed information

-aux Show all itineraries that contain other users

-C < commands > lists the status of the specified command

--lines < rows > number of rows displayed per page

--width < characters > The number of characters displayed per page

--HELP Display Help information

--version Display version display

4. Usage examples

Show All process information

Ps-a

Display information for a specified user

Ps-u Root

Show all process information, along with command line

Ps-ef

PS and grep common use combination to find specific processes

Ps-ef | grep ssh

List the PID and related information that is currently your own log in.

Ps-l

Linux under PS command

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.