View and terminate processes in linux

Source: Internet
Author: User
Article Title: View and terminate processes in linux. 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.

1. after 1-2 characters are entered on the LINUX Command platform, pressing the Tab key will automatically complete the following parts (the premise is that you have this thing, for example, when tomcat is installed, enter tomcat to tab ).

2. The ps command is used to view the currently running process.

Grep is search

Example: ps-ef | grep java

Displays information about java CMD processes in all processes.

Ps-aux | grep java

-Aux: Show All statuses

Ps

3. The kill command is used to terminate the process.

Example: kill-9 [PID]

-9 indicates that the process is forced to stop immediately.

You can use ps to view the process PID and kill to terminate the process.

Online content

Bytes -----------------------------------------------------------------------------------

PS

Bytes -----------------------------------------------------------------------------------

1. ps Overview

Ps command is a very powerful process view command in the most fundamental circumstances. this command can be used to determine which processes are in the running and running status, whether the process is terminated, whether the process is dead, and which processes occupy excessive resources. in short, most of the information can be obtained by executing this command.

2. ps command and its parameters

Ps commands are most often used to monitor the working conditions of background processes because background processes do not have standard input/output settings such as the screen keyboard.

To detect the situation, you can use the ps command.

The syntax of this command is as follows:

Ps [Option]

-E: displays all processes and environment variables.

-F full format

-H: No title is displayed.

-L long format

-W width output

A: displays all processes on the terminal, including those of other users.

R only displays Running Processes

X indicates that no terminal process is controlled.

O [+ |-] k1 [, [+ |-] k2 [,…] The process list is displayed in the multi-level sorting order specified by the shortcut KEYS in short keys, k1, and k2.

The default sequence is specified for different ps formats. these default sequence can be overwritten by user-specified. here, the "+" character is optional, and the "-" character is used to reverse the specified key direction.

Pids lists only process identifiers separated by commas (,). The process list must be followed by the last option of the command line parameter. spaces cannot be inserted in the list. For example, ps-f1.

The following describes long command line options. These options start:

-- Sort X [+ |-] key [, [+ |-] key [,…] Select a multiple KEYS from the sort keys segment. the "+" character is optional, because the default direction is in ascending order of numbers or dictionary order. for example, ps-jax-sort = uid,-ppid, + pid.

-- Help: displays help information.

-- Version: displays the local version of the command.

The sort key is mentioned in the preceding option description. Next, we will further describe the sort key. note that the land use value in the sorting operation is the internal value of the ps application, not only the pseudo value in some output formats. the sorting Key List is shown in Table 4-3.

Table 4-3 sorting Key List

C

Cmd

Executable simple name

C

Cmdline

Complete command line

F

Flags

Long MODE flag

G

Pgrp

Process location group ID

G

Tpgid

Control tty Process Group ID

J

Cutime

Cumulative user time

J

Cstime

Accumulative system time

K

Utime

User time

K

Stime

System time

M

Min_flt

Number of secondary page error locations

M

Maj_flt

Number of Key page error locations

N

Cmin_flt

Accumulative secondary page Error

N

Cmaj_flt

Accumulative Key page Error

O

Session

Dialog ID

P

Pid

Process ID

P

Ppid

Parent process ID

R

Rss

Resident size

R

Resident

Resident page

S

Size

Memory size (kilobytes)

S

Share

Number of shared page locations

T

Tty

Tty secondary device number

T

Start_time

Process start time

U

Uid

UID

U

User

User Name

V

Vsize

Total number of local virtual memory (bytes)

Y

Priority

Kernel scheduling priority

[1] [2] Next page

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.