Bashshell script exercises

1. determine disk space usage df-h | grep-vFile | sed's/% // G' | awk '{if ($5 & gt; 80) print "used space exceeds 80%:", $6} 'or #! /Bin/bash 1. Determine the disk space usedDf-h | grep-v File | sed's/% // G' | awk '{if ($5> 80) print "The

Install tftp server in redhat5.6

In redhat5.6, tftp Server Installation-general Linux technology-Linux technology and application information. The following is a detailed description. Originally my system is not tftp this file, I went to the Internet to find A, the results of the

Batch clear Nginx cache using Shell scripts

Preface * with the development of the entire Internet, there have been countless websites, large and small. As a result, users are increasingly enhancing their website UI and speed experience. For enterprises or individuals, winning the user

Php-fpm is prone to false positives, and shell automatically restarts the php service.

It runs continuously through the background, and restarts if any problem is detected. There are few script codes, the statements are very simple, and the consumption of system resources is very low. You can try it. It seems stupid, but it is

Shell detects the network status script of the IP address of the entire network segment through ping

To Ping all IP addresses in a CIDR Block and check whether the network connection status is normal, many methods can be implemented. The following describes two methods: Script 1 #! /Bin/sh # Ping all IP addresses in the CIDR block #2012/02/05 ip = 1

The most expensive line of code in the world

The most expensive line of code in the world-general Linux technology-Linux programming and kernel information. The following is a detailed description. If (is. opera) {window. location. href = "config/error.htm ";} Background: One line of JS Code

Shell Method for reading objects cyclically by row

Commonly used code for linuxshell to read objects cyclically by line is as follows: #/bin/bashprintf "********************************** * ** \ n "echo" catfilewhielreadline "cattest.txt | whilereadlinedoecho $ lin The common code for linux shell

A question about text editing and drawing in GTK2.0

A question about text editing and drawing in GTK2.0-Linux general technology-Linux programming and kernel information. The following is a detailed description. I created a text editor under GTK2.0 using textview, but at the same time I need to

Difference between continue and break in shell

The break command can contain one parameter. A break loop without a parameter can only exit the innermost loop, while breakN can exit the N-layer loop. The continue command can also contain a parameter. A continue command without a parameter only

Const Pointer Reference

Const pointer references-general Linux technology-Linux technology and application information. For more information, see the following section. Void proc (char * const & lp, int len, int * const & shu1, int & n) In my understanding, const modifies

Shell script for intelligent viewing

First, I did not write the script functions here. If you are interested, you can do it yourself. You have not written the shell script for a long time. If you write this script today, you should review it, I have been using python for a long time.

Add and delete apahce VM in shell script and check whether the VM is normal

1install sendemailtarxvfsendemail-v1.56.tar.gz mvsendEmail-v1.56sendEmail2 add apache Virtual Host shell script: viaddVirtual. sh #! /Bin/bashcat & lt; EOF & gt;/etc/httpd/conf/httpd. conf & lt; VirtualHost *: 80 & gt ;& 1. Install sendEmail Tar xvf

Help: Master systemshell

Help: systemshell master-Linux general technology-Linux programming and kernel information, the following is a detailed reading. Recently, I encountered a problem where one of my linux processes (which is very large and occupies 70% of the machine's

Five common centos server monitoring script codes

Five common Linux monitoring scripts are provided for you to view the disk space of the host Nic traffic, system status monitoring, and host monitoring, when the usage space exceeds 90%, you can send a mail to send a warning, monitor CPU and memory

Use shell commands to operate Memcached

Data storage (assume key is test, value is 12345) printf "settest005 \ r \ n12345 \ r \ n" | nc127.0.0.112000STORED data retrieval (assuming key is test) pri Data storage (assuming the key is test and the value is 12345) Printf "set test 0 0 5 \ r \

Accurately clear the Squid cache using SHELL scripts

This script was modified on the cache cleanup script of Zhang banquet, mainly to add the if option, and select the address of the cached file based on the $1 parameter type (because $1 is not fixed, sometimes it is a specific jpg type, sometimes it

Use shell scripts to monitor website status

Recently, the server room where the company is located is often unable to access the website due to attacks and network faults. In order to be able to know that the website is inaccessible for the first time and quickly solve the problem, tley uses

Shell script file execution Analysis

I. shell script parent-child process analysis code :#! /Bin/bashecho $ ps-ef | grep 'echo $ 'echo "-------------------------------------" (pwd; echo $; ps-ef | grep 'echo $ ';) echo" I. shell script parent-child Process Analysis   Code: #!/bin/bash

Automatic shell disk monitoring

Catdisk. sh #! /Bin/bashforiin 'df | sed1d | awk & #39; {print $5} & #39; | sed & #39; s/% // g & #39; ##### compare the loop size after obtaining #### doif [$ i-gt10] ### here the threshold value is set to 10, to facilitate the test result ###

Yum source settings

Yum source settings-general Linux technology-Linux technology and application information. For more information, see. $ Yum update Plugin "product-id" can't be imported Plugin "subrole-manager" can't be imported Loaded plugins: refresh-packagekit

Total Pages: 2732 1 .... 1745 1746 1747 1748 1749 .... 2732 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.