LINUX redhat Seventh Unit documentation

Source: Internet
Author: User
Tags arithmetic

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


Two 2.ps commands
Ps
A # #关于当前环境的所有进程
X # #与当前环境无关的所有进程
F # #显示进程从属关系
E # #显示进程调用环境工具的详细信息
L # #长列表显示进程的详细信息
U # #显示进程的用户信息

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8F/8F/wKiom1jk5DvhI4Z3AAPOY-UeV-k939.png-wh_500x0-wm_ 3-wmp_4-s_3553556207.png "style=" Float:none; "title=" screenshot from 2017-04-05 20-33-04.png "alt=" Wkiom1jk5dvhi4z3aapoy-uev-k939.png-wh_50 "/>

650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8F/8D/wKioL1jk5ECjFGe9AAP5c8FenlA508.png-wh_500x0-wm_ 3-wmp_4-s_2601372431.png "style=" Float:none; "title=" screenshot from 2017-04-05 20-33-39.png "alt=" Wkiol1jk5ecjfge9aap5c8fenla508.png-wh_50 "/>


PS Ax-o%cpu,%mem,user,group,comm,nice,pid # #指定显示进程的某些信息
%CPU # #显示进程cpu负载
%mem # #显示进程内存负载
User # #进程用户
Group # #进程组
Comm # #进程名称
Nice # #进程优先级
PID # #进程的id

PS ax-o%cpu,comm--sort <+|-%cpu > <+|-%mem> # #按照进程信息排序
+ # #正序
-# #倒序
%CPU # #cpu负载排序
%mem # #内存负载

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8F/8F/wKiom1jk5MuxKr8BAAP5c8FenlA162.png-wh_500x0-wm_ 3-wmp_4-s_3222024056.png "title=" screenshot from 2017-04-05 20-33-39.png "alt=" Wkiom1jk5muxkr8baap5c8fenla162.png-wh_50 "/>



Three. Process priority
1. Priority scope of the process
-20~19

2. Priority view
PS Ax-o Pid,nice,comm

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8F/8F/wKiom1jk5TLQ84dYAAN7oslRFug307.png-wh_500x0-wm_ 3-wmp_4-s_3824321322.png "title=" screenshot from 2017-04-05 20-37-52.png "alt=" Wkiom1jk5tlq84dyaan7oslrfug307.png-wh_50 "/>
3. Specify a priority to open the process
Nice-n Priority Numeric Process name
Nice-n-5 Vim & # #开启vim并且指定程序优先级为-5

4. Change the process priority
Reince-n Priority Digital Process PID
Renice-n-5 1806 # #改变1806进程的优先级为-5
[Email protected] ~]# PS a-o pid,nice,comm
PID NI COMMAND
614 0 Xorg
1128 0 Agetty
1625 0 Bash
1785 0 Vim
1806-5 vim
1824-5 vim
1835 0 PS

Four. Front and back calls to processes in the environment
Jobs # #查看被打入环境后台的进程
CTRL + Z # #把占用终端的进程打入后台
FG # #把后台进程调回前台
BG # #把后台暂停的进程运行
Comm & # #让命令直接在后台运行


Five. Process signal
1. Common signal levels
1 # #进程重新加载配置
2 # #删除进程在内存中的数据
3 # #删除鼠标在内存中的数据
9 # #强行结束单个进程 (cannot be blocked)
# #正常关闭进程 (may be blocked)
# #运行暂停的进程
# #暂停某个进程 (cannot be blocked)
# #把进程打入后台 (can be blocked)
Man 7 Signal # #查看信号详细信息

Kill-Signal Process PID
Killall-Signal Process name
Pkill-u Student-Signal

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

Six. User Login Audit

1
W # #查看使用系统的当前用户有那些
W-f ##-f see where to use

2
Last # #查看用户登陆成功历史
3.
LASTB # #查看用户登陆未成功历史



Seven. Top command
Top # #监控系统负载工具

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/8F/8D/wKioL1jk5gCj2yH0AAR-FrAoQQA977.png-wh_500x0-wm_ 3-wmp_4-s_2675085598.png "title=" screenshot from 2017-04-05 20-41-23.png "alt=" Wkiol1jk5gcj2yh0aar-fraoqqa977.png-wh_50 "/>

LINUX redhat Seventh Unit documentation

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.