Control of Linux processes and services

Source: Internet
Author: User

One: Control of processes and services
1. What is a process
Programs that are in progress in the system
2. How the graphics process is viewed
Gnome-system-monitor

3. View the commands for a process
PS Viewing process

A current process-related process (contains information about the current environment itself)

-a displays all processes in the current terminal (without the current environment itself information)

-A|-E System All Processes


x contains all processes containing the terminal (must contain a TTY (character output device))

F Viewing the dependencies of a process

Everyone of the U-process

PS ax-o comm,nice,%cpu,%mem,pid,user,group,stat View ...

PS Ax--sort=%cpu default to ascending order

PS Ax--sort=-%cpu Descending order

4. Priority of the process
-20 ———— 19
The smaller the number, the greater the priority.
Renice-n 5 2580
S Process State
s This process is a top-level process
The T process is temporarily stopped
High priority of the process
The ' empty ' process has a normal priority
N-Process Priority low
L process has lock space in memory

Renice-n-5 PID Specifies the priority of the modification process

Nice-n-5 Command & Assign priority to open a process

5. Calls to and from the process
CTRL + Z will occupy the terminal process into the background stop

Jobs View all processes temporarily suspended in the current background

BG Jobsnum to run the specified process in the background

FG Jobnum Returning the specified process to the foreground

CTRL + C will consume the current terminal's process end

6. Signal
1 reloading the configuration without stopping the process
2 Purging process in-memory data
3 clearing the mouse's in-memory data
9 forcibly ending a process

15 Normal shutdown process (blocking control of file permissions and control of processes and services)

18 Running a stopped process

19 Suspend process (cannot be blocked)

20 Pause process (can be blocked)

Kill Signal PID
Killall Signal Process Name
IP addr Show Br0 real machine query the IP address of this machine

Ifconfig eth0 Virtual Machine Query the IP address of this machine

7. Control of the service
Systemctl Start Sshd.service Open

Systemctl Stop Sshd.service Stops
Systemctl Status Sshd.service View status
Systemctl Retart sshd.service Restart

Systemctl Enable Sshd.service Boot

Systemctl list-units List Current system-enabled services

SYSTEMCTL list-unit-files list service boot status in the system

Systemctl Mask sshd

Systemctl unmask sshd

Systemctl
Level has 0-6, 0 is shutdown, 6 is reboot, 234 is

Control of Linux processes and services

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.