A shell script that you wrote to patrol the Linux process

Source: Internet
Author: User

#/bin/Bashhint () {Read-P"Press Enter Tocontiune:"}check_a () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1//use grep and awk to filter the process into Text1. sed '/^.*/s///g'Text1 >text3//delete Text1 in front of empty row in Text3grep-VWF Text3 Text2//Statistics TEXT3 There are no rows in the Text2, so you can find out what those processes are not. Note: Text2 is a standard process fileRM-RF Text1 Text3} Check_b () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1sed '/^.*/s///g'Text1 >Text3grep-vWF Text3 Text2RM-RF Text1 Text3} Check_c () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1sed '/^.*/s///g'Text1 >Text3grep-vWF Text3 Text2RM-RF Text1 Text3} whileture//Menu making DoClearEcho "############################################"Echo "1. Check a device process" Echo "2. Check the B device process" Echo "3. Check the C device process"Echo "4. Exit the program"Echo "############################################"Read-P"Please enter the device process number to be checked:"U_select Case$U _selectinch    1) check_a HINT;; 2) Check_b HINT;; 3) Check_c HINT;; 4) exit;; *) Read-P"Please Select 1-3,press Enter to contine:"Esac  Done

The server for production deploys a number of standard services that can be quickly monitored with this script when we are done deploying. The main use of standard process files with the native process files, grep comparison to find out the difference.

A shell script that you wrote to patrol the Linux process

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.