Shell script code Summary for the detection process _linux shell

A simple shell script to find out if a critical service is running and is suitable for Linux or UNIX operating systems.The script can also send notifications using e-mail. Code: Copy Code code as follows: #!/bin/bash #

Shell Script Analysis Nginx The most and time-consuming pages of log visits (slow query) _linux shell

When the server pressure is larger, running very laborious time. We often do Site page optimization, will go to find those pages are more frequent, and more time-consuming. Find the addresses that are high and time-consuming, and the related

Using Linux timerfd_create to implement Timer sample sharing _linux Shell

Timer_poll.h Copy Code code as follows: /* * File:timer_poll.h * Author:administrator */ #ifndef Timer_poll_h#define Timer_poll_h#include #include #include #include #include #include #include #include #include #include #include

6 ways for Linux to delete a large number of files _linux shell

Create 500,000 files first Copy Code code as follows: Test for I in $ (seq 1 500000) For> do for> echo Test >> $i. txt For> Done 1 RM Copy Code code as follows: Test Time Rm-f * Zsh:sure you want to

Program to get the Linux system start time method _linux Shell

1. Preface Time is very important to the operating system, from the kernel level to the application layer, the time expression and precision of the same. The Linux kernel uses a constant named Jiffes to compute the timestamp. Application layer has

Linux command detailed method of mounting the optical drive _linux Shell

Linux hardware devices in the/dev directory, the optical drive is one of them./dev/cdrom represents the optical drive, the method of mounting the optical drive is as follows (in root): Copy Code code as follows: Mkdir/mnt/cdrom

How to use Linux command switching directory _linux shell

1.CD-The function is to quickly switch to the previous directory , as follows: Copy Code code as follows: amosli@amosli-pc:~$ CD learn/fd/ amosli@amosli-pc:~/learn/fd$ CD- /home/amosli 2.dirs: Display the directory stack,

Linux View directory four ways (LS only show directory) _linux Shell

1.ls-d * Copy Code code as follows: amosli@amosli-pc:~$ ls-d * %appdata% Develop many Sorted.txt workspace Bank Documents Music Space Download 2. Find.-type d-maxdepth 1 If you do not add-maxdepth parameters, then

Wscript.Shell Object Detailed Introduction!! Special Good Things 1th 2 page _vbs

Category: Programs WshShell objects ProgID Wscript.Shell FileName Wshom.ocx CLSID f935dc22-1cf0-11d0-adb9-00c04fd58a0b IID f935dc21-1cf0-11d0-adb9-00c04fd58a0b The following table describes the properties associated with the WshShell

Single-machine traffic statistic function implemented by shell script _linux Shell

On the internet to see this single flow of the script, very good. Copy Code code as follows: #!/bin/sh Usage () { echo "Usage: $ [i INTERFACE] [-S INTERVAL] [-C COUNT]" Echo echo "-I INTERFACE" echo "The interface to monitor, and

Shell script implementation automatically modifies IP address _linux shell

As a Linux SA, many parts of the day-to-day operation of the script, and the server's IP is generally static IP or Mac binding, of course, the latter is relatively cumbersome to operate, and the former we can set the host name, IP information,

Shell script realizes IP address legality judgment _linux shell

Do unix/linux under the development, scripting skill is indispensable, as Shell programming, is also a profound technical field, here in order to learn, write a simple IP address is the legal micro-script program, this small program is also very

Ways to process JSON data at the shell command line _linux Shell

Because I've been working on some JSON data formats recently, I finally found JQ this great tool after a search. JQ allows you to manipulate JSON directly under the command line, including slicing, filtering, converting, and so on.Let's use a few

How to debug shell scripts with built-in variables _linux shell

The general shell script debugging is basically echo to deal with the larger script when, it is more trouble, out of the question, is not very good to locate which line of code problems.In fact, some of the variables built into the shell can be a

Shell arithmetic and comparison _linux shell

1. Operator (let marker) + Addition-Subtraction* Multiplication/Division* * Power operation3 Let "z=5**3"% modulobash$ Expr 5% 3 2. The comparison character (note [] and the variable need Space "") Integral type comparison character-eq equals,

The shell script matches the email in the file and writes it to the file. Code sharing _linux Shell

The code is as follows: Copy Code code as follows: #! /bin/bash function Read_file () { For line in ' cat $ ' Todo If [' Echo $line |grep ' ^[a-za-z0-9_-]*@[a-za-z_-]*\.[ a-za-z_-]*$ "'];then echo $line >> Result.txt Else

3 ways the shell reads files by row _linux Shell

There are a lot of ways, and here are three ways to write: Writing a: Copy Code code as follows: #!/bin/bash While Read line Todo Echo $line Done Writing two: Copy Code code as follows: #!/bin/bash Cat

Linux traffic monitoring shell script _linux Shell

Recently more busy, for a long time did not update the blog, today is not busy writing a traffic monitoring script. The test has passed under the CentOS, has the need friend to try, has the bug or needs to add other function words can leave a

How to implement sudo command without input password using pipelines _linux shell

Because of the study of PHP, I also installed a XAMPP integrated environment package under Linux. But every time you start to enter the terminal, and then point Open/opt/lampp/, then sudo to perform manager-linux-x64.run operation, to open the XAMPP

Shell calculates average connection time function based on Web log _linux shell

Today on the Internet to see a web connection average time of the shell command, in their own machine tried, found that can not use, incredibly appear awk:fatal:division by zero attempted such a mistake, Mao's own changed the shell command.

Total Pages: 541 1 .... 302 303 304 305 306 .... 541 Go to: GO

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.