The process in Linux is explained

Source: Internet
Author: User
Tags arithmetic

1. Process definition
Process is the work that the CPU does not complete

2.ps command
Ps

l long format output;

U displays the process in the order of the user name and start time;

J Use the task format to display the process;

F to display the process in a tree-shaped format;

A shows all processes of all users (including other users);

X shows the process without control terminal;

R shows the running process;

WW avoids detailed parameters being truncated;

-A list all the processes

-W show widening to show more information

-au Show more detailed information

-aux Show all processes that contain other users

-e Show all processes, environment variables

-F Full Format

-H do not show title

-L Long Format

-W Wide Output

A shows all processes on the terminal, including other user processes

R shows only the running process

X shows no control of the terminal process

Our common option is that the combination is aux or lax


PS Ax-o%cpu,%mem,user,group,comm,nice,pid Specify some information for the display process

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M00/9C/77/wKioL1lwqqvBplXIAAASFUHXzQM821.png-wh_500x0-wm_ 3-wmp_4-s_3804782495.png "title=" Ps.png "alt=" Wkiol1lwqqvbplxiaaasfuhxzqm821.png-wh_50 "/>

%CPU Show Process CPU load
%MEM Show Process Memory load
User process Users
Group process Groups
Comm Process Name
Nice process priority
The ID of the PID process

PS ax-o%cpu,comm--sort <+|-%cpu > <+|-%mem> Sort by process information
+ Positive Order
-Reverse
%CPU # #cpu负载排序
%mem # #内存负载
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9C/77/wKiom1lwqwyR6L41AAAbNTGc_o0864.png "title=" Pat. png "alt=" Wkiom1lwqwyr6l41aaabntgc_o0864.png "/>

3. Process priority
Priority range of the process
-20~19

Priority view
PS Ax-o Pid,nice,comm

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9C/78/wKioL1lwq6bgXE5zAAAlzIk13-I383.png "title=" 00. PNG "alt=" Wkiol1lwq6bgxe5zaaalzik13-i383.png "/>

Specify a priority to open a process
Nice-n Priority Numeric Process name
Nice-n-5 Vim & start Vim and assign program priority to-5


Change the process priority level
Reince-n Priority Digital Process PID
Renice-n-5 1806 Change 1806 process priority is-5

4. Front and back calls to processes in the environment
Jobs view the process of being driven back into the environment

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9C/78/wKioL1lwrr3je3wjAAARFJWEeMU910.png "title=" a.png "alt=" Wkiol1lwrr3je3wjaaarfjweemu910.png "/>

ctrl+z           the process that consumes the terminal into the background
fg                  Back up the background process to the foreground
bg                 Run a background suspended process
Comm &      let commands run directly in the background


5. Process signal
1. Common signal level
1         Process reload configuration
2          Delete a process in-memory data
3         Delete mouse in-memory data
9          forcibly ends a single process (cannot be blocked)
15       Normal shutdown process     (may be blocked)   
18       running a paused process
19        pause a process     (cannot be blocked)
20       the process into the background      (can be blocked)
Man 7 signal    # #查看信号详细信息

Kill-signal process PID

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9C/78/wKiom1lwsqvCY2Y3AABWY7JhhcQ753.png "title=" Screenshot from 2017-07-20 21-39-20.png "alt=" Wkiom1lwsqvcy2y3aabwy7jhhcq753.png "/>


Killall-Signal Process name

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9C/78/wKioL1lwsmSxcmH-AACANjDQlbU089.png "title=" Screenshot from 2017-07-20 21-38-07.png "alt=" Wkiol1lwsmsxcmh-aacanjdqlbu089.png "/>


Pkill-u Student-Signal

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9C/78/wKioL1lwsziTIzFPAAB7PjYp76I504.png "title=" Screenshot from 2017-07-20 21-41-45.png "alt=" Wkiol1lwszitizfpaab7pjyp76i504.png "/>
SIGHUP terminating process terminal line hang-off
SIGINT terminating process Interrupt process
Sigquit establish core file termination process, and generate core file
Sigill Creating a core file illegal directive
SIGTRAP build core file tracking self-trapping
Sigbus establishing a core file bus error
SIGSEGV creating core file Segment Illegal error
SIGFPE creating a core file floating point exception
Sigiot creating a core file to perform I/O self-trapping
SIGKILL Terminate process Kill process
Sigpipe terminating a process writing data to a pipeline that does not have a read process
Sigalarm Terminating process timer to
SIGTERM terminating process software termination signal
SIGSTOP stop signal stop process non-terminal
SIGTSTP stop signal to stop the process terminal
Sigcont ignore signal continue execution of a stopped process
Sigurg ignoring signal I/O emergency signal
SIGIO ignoring the signal descriptor can be I/O
SIGCHLD Ignore signal Notify parent process when child process stops or exits
Sigttou Stop process background process write terminal
Sigttin Stop process background process read Terminal
SIGXGPU terminating process CPU time-out
SIGXFSZ termination process file length too long
Sigwinch ignoring signal window size changes
SIGPROF terminating process statistics distribution graph with timer to time
SIGUSR1 terminating a process user-defined signal 1
SIGUSR2 terminating a process user-defined signal 2
SIGVTALRM terminating process virtual timer to time

1) SIGHUP
This signal is issued at the end of the user terminal connection (normal or abnormal), usually in the terminal control
At the end of the process, notify each job in the same session, and the control terminal
is no longer associated.
2) SIGINT
program termination (interrupt) signal, which is emitted when the user types Intr characters (usually ctrl-c)
3)
Sigquit and SIGINT are similar, but are controlled by the Quit character (usually ctrl). Process in response to receipt
Sigquit exit will produce a core file, in this sense similar to a program error letter
No..
4)
Sigill executed an illegal instruction. This is usually due to an error in the executable file itself or an attempt to execute
Data segment. This signal can also be generated when a stack overflows.
5)
The SIGTRAP is generated by a breakpoint instruction or other trap instruction. Used by debugger.
6)
The SIGABRT program itself discovers the error and calls abort when it is generated.
6)
The Sigiot is generated on the PDP-11 by the IoT instructions, on other machines and SIGABRT.
7)
Sigbus illegal address, including memory address alignment (alignment) error. Eg: access to a four word length
Integer, but its address is not a multiple of 4.
8)
SIGFPE is emitted when a fatal arithmetic operation error occurs. Includes not only floating-point arithmetic errors, but also overflow
The sum of the divisor is 0 and all other arithmetic errors.
9)
The SIGKILL is used to immediately end the run of the program. This signal cannot be blocked, processed and ignored.
10)
SIGUSR1 left for users to use
11)
SIGSEGV attempts to access memory that is not allocated to itself, or attempts to write data to a memory address that does not have write permissions.
12)
SIGUSR2 left for users to use
13)
Sigpipe Broken Pipe
14)
The SIGALRM clock timing signal calculates the actual time or clock time. The alarm function uses the
Signal.
15)
SIGTERM program End (terminate) signal, unlike Sigkill, the signal can be blocked and
Processing. Usually used to ask the program to exit normally. The shell command kill default produces this
A signal.
17)
At the end of the SIGCHLD child process, the parent process receives this signal.
18)
Sigcont let a stop (stopped) process continue execution. This signal cannot be blocked. can be used
A handler that allows the program to complete a specific application when the stopped state changes to continue execution.
Job. For example, to re-display the prompt
19)
SIGSTOP the execution of the Stop (stopped) process. Notice the difference between it and terminate and interrupt:
The process is not over yet, just pausing execution. This signal cannot be blocked, processed or ignored.
20)
SIGTSTP stops the process from running, but the signal can be processed and ignored. When a user types Susp characters
(usually ctrl-z) sends this signal
21)
Sigttin when a background job wants to read data from a user terminal, all processes in that job receive Sigttin
Signal. By default, these processes stop executing.
22)
Sigttou is similar to Sigttin, but is received when writing a terminal (or modifying terminal mode).
23)
Sigurg is generated when "emergency" data or Out-of-band data arrives at the socket.
24)
SIGXCPU exceeds CPU time resource limit. This limit can be read by Getrlimit/setrlimit/
Change
25)
Sigxfsz exceeds the file size resource limit.
26)
SIGVTALRM virtual clock signal. is similar to SIGALRM, but calculates the CPU time that is consumed by the process.
27)
Sigprof is similar to SIGALRM/SIGVTALRM, but includes the CPU time used by the process and the system call
Time.
28)
Sigwinch when the window size changes.
29)
The SIGIO file descriptor is ready to start the input/output operation.
60L
SIGPWR Power Failure

There are two signals to stop a process: Sigterm and Sigkill. Sigterm is friendly and the process captures the signal and shuts down the program according to your needs. Before you close the program, you can end the open record file and complete the task you are doing. In some cases, if the process is working and cannot be interrupted, the process can ignore the sigterm signal.

For Sigkill signals, the process cannot be ignored. This is a "I don't care what you are doing, stop immediately" signal. If you send a sigkill signal to the process, Linux will stop the process there

6. User Login Audit

1
W View current users using the system have those
W-f-F view where to use

2
Last View User Login success History
3.
LASTB View User Login unsuccessful history



7.top command
Top Monitoring System Load Tool

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9C/78/wKiom1lwr13xnJ26AACXXOx55qQ803.png "title=" 1.png "alt=" Wkiom1lwr13xnj26aacxxox55qq803.png "/>




The process in Linux is explained

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.