The process and service control of Linux system

Source: Internet
Author: User
Tags cpu usage

1. What is a process?

?? The program that is running in the system.

2. How to view the process of graphics

?? Gnome-system-monitor

3. View the process commands

?? Whatis?ps

3.1ps
?? View process

3.2ps?a
?? View the processes associated with the current environment (including information about the environment itself).

3.3ps?-a
?? View the processes that are running at the current terminal, but do not contain the current environment process.

3.4ps?-a|-e
?? View all processes of the system.


3.5ps?x
?? View the process that contains the output terminal.

3.6ps?f
?? View the dependencies of the process.

3.7ps?u
?? View the owner of the process.

3.8ps?l
?? long list display.

3.9ps?ax?-o? Specify information
?? View the specified information for the process.
?? Example: Ps?ax?-o?comm,%cpu,%mem,pid,user,group,stat

3.10ps?ax?--sort= Sorting criteria
?? Sorts the display process by the specified criteria. For example:
?? The process is displayed in the positive order of CPU usage:

?? To display the process in terms of CPU usage:

?? The process is displayed in the positive order of memory usage:

?? Display the process in reverse order of memory usage:

3.11 Comprehensive application to view PID of the first five processes in reverse order of CPU usage
?? Ps?ax?--sort=-%cpu?-o?pid?|? sed?-n?2,6p

4. Priority of the process

?? S?: Process Status
?? S?: Indicates that this process is a top-level process
?? T?: Indicates that the process is a paused state
?? <?: High Process priority
?? N?: Low Process priority
?? L?: Process has lock space in memory
?? Renice?-n? pid?: Modify the priority of the process, for example, change the priority of the process PID to 6245 from 5 to-8

?? Nice?-n? priority?: Specify priority to open the process, for example, specify to turn on Firefox and assign its priority to-5

?? Ps?-o? Specify information?: View the specified information for the process, for example, view the PID of the process and nice

5, the process before and after the call

?? Ctrl?z.: Stops the process that consumes the terminal from entering the background.
?? Ctrl?c: Ends the process that occupies the current terminal.
?? Jobs: View the processes that have been driven into the background.

?? Bg?jobsnum?: Runs the specified process in the background.

?? Fg?jobsnum: The specified process is recalled to the foreground.

6. Common signals

?? 1?: Reload the configuration without stopping the process.
?? 2?: Clears the data in memory of the process.
?? 3: Clear the mouse data in memory.
?? 9: Forcibly ends the process and cannot be blocked.
?? 15: Normal shutdown process.
?? 18: Run a stopped process.
?? 19: Pause the process and cannot be blocked.
?? 20?: Pauses the process.
? related commands?:
?? Kill signal PID?: Sends the signal to operate the PID corresponding process.
?? Killall? signal process name?: sends a signal to operate on all processes that specify the process name.

7, the control of the service

7.1systemctl?start?sshd
?? Open
7.2systemctl?stop?sshd
?? Shut down
7.3systemctl?status?sshd
?? Display status
7.4systemctl?restart?sshd
?? Restart
7.5systemctl?enable?sshd
?? Boot up
7.6systemctl?disable?sshd
?? Powering off
7.7systemctl?list-units?sshd
?? List services running in the system
7.8systemctl?list-unit-files?sshd
?? List service boot status in the system
7.9systemctl?list-dependncies?sshd
?? List service dependencies
7.10systemctl?mask?sshd
?? Freeze Service
7.11systemctl?unmask?sshd
?? Unlock Service
7.12systemctl?set-default?multi-user.target
?? Do not start graphics on boot
7.13?set-default?graphical.target
?? Boot up graphics

8. Using IP to control real or virtual machine under Linux system

8.1 View IP command br/>?? View Virtual Machine Ip:?ifconfig?eth0
?? View Real Machine Ip:?ip?addr?show?br0
**8.2 control real or virtual machine commands * *
[email protected]?: Graphical control.
[Email protected]?: No graphical control.
8.3 See who has control over the computer
Last: Who was logged in to the computer.
W-F: The computer has been logged on by who is running.
LASTB: The computer was attempted to log on but was unsuccessful.
Kill-9 PID: termination is controlled.

The process and service control of Linux system

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.