CENTOS7 process Operations/System administration commands

Source: Internet
Author: User
Tags file copy

Ps-ef--View the processes in the system

Ps-ef | More--View the process in the system, can be a page by Page view

Ps-ef | grep FIREWALLD--View firewall process

In Linux, processes are generated by the parent process, and there is only one process that does not have a parent process.

is the process with ID 0--pid: Process PPID: Parent process

Which FIREWALLD--see what executable programs firewalld have

Kill 797--stop FIREWALLD This process, FIREWALLD process ID is 797, you can view the process ID by PS-EF command

Kill-9 797--If the kill command cannot be removed, you can add a-9 parameter to force the deletion

Man PS--if the parameters of the PS command are not clear, we can view them by man.

When the command parameters are unclear, the help can be viewed through the man command

-----------------------------------------------------------------------------------

Cases:

How to write a process script, we can use some commands to put it to the foreground or put it in the background to run

First write a a.sh script with VI (the purpose of this script is to print out the fished! after hibernation 1000S)

Cd/tmp/test

VI a.sh

#!/bin/bash

Sleep 1000--the meaning of hibernation, let the script hibernate 1000S

Echo fished!

WQ--Save

[[Email protected] test]#./a.sh--Execute a.sh script, sometimes error is not sufficient, remember chmod 777 a.sh change the highest permissions

Run the a.sh script, if this runs, it will occupy the current terminal, card can not do other operations here, so to switch the background process to run

./a.sh &--run the a.sh script in a background process

Ps-ef | grep a.sh--to see if the script is running

Jobs-View processes running in the background, but excluding system processes

FG%1--a.sh background process switch foreground process run 1 is the process number of the background process, and jobs can see that we will see it occupy the current terminal

CTRL + Z can continue to put the foreground process into the background, and stop (at this time, jobs view, status will render stop)

Kill-cont 3993--can keep scripts running in the background, with jobs presenting running status

Kill-stiop 3993--Pause the script

-----------------------------------------------------------------------------------

wget--Can download files on some servers

SCP-Remote File copy program

SCP index.htlm [email protected]/:root --Copy the native INDEX.HTLM to the root directory under the remote 172.16.45.220 host, log in as root

Hostename bob.com--temporarily change the hostname, currently in effect, restart to restore the previous host name

Vim/etc/hostname--Change the hostname profile to take effect permanently

Vim/etc/hosts--Modify ETC Host value
Vim/etc/resolv.conf--Temporarily modify the DNS configuration file


Reboot--Restart the server
Init 0--Shut down the server
Shutdown-h now-close the machine immediately
Shutdown-h 18:00--Set 18:00 shutdown


Free--View physical memory and virtual memory
Top-View CPU utilization, refresh every 5S

CENTOS7 process Operations/System administration commands

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.