This section describes several shell scripts that can be used to extract I/O information from the disk, system load load information, and so on
1, extract the system load information
Copy Code code as follows:
#!/bin/sh
host=$ (hostname)
This article mainly introduced in the shell for And while loop detailed summary, this article explained for the For Loop's digital section form, detailed lists, to the file circulation, while loop's three kinds of use situation and so on content,
Now on the market to sell U disk, from the material, there are metal u disk, silicone u disk, Jade U disk, Plastic (PVC) u disk and so on. One PVC and silicone disk is more popular. However, most users are still difficult to distinguish between the
1. Automatic Ssh/scp method
A is a local host (that is, a machine used to control other hosts);b is a remote host (that is, a controlled machine server), if IP is 192.168.60.110;Both A and B systems are Linux.
To run a command on a:# ssh-keygen-t
This shell script is primarily used for initialization of newly installed Linux server systems, including:
Turn off the IPV6 module
Close SELinux
Let vim display color
Set System language encoding
Optimizing System Services
Kernel parameter
Copy Code code as follows:
#!/bin/sh
Mypath= "/var/log/httpd/"
Myfile= "/var/log/httpd/access.log"
#这里的-x parameter to determine whether $mypath exists and has executable permissions
if [!-X "$myPath"]; Then
mkdir "$myPath"
1. Send mail in command line mode
1.1 Installation SendEmail
2.2 Using SendEmail and examples
2. Command line mode of receiving mail
2.1 Installation Getmail4
2.2 Configuration Getmail4 and simple examples
2.3 Using Munpack to extract attachments
The awk function split (S,A,SEP) splits a string s into a awk array a using the delimiter Sep.
Set time = 12:34:56Set hr = ' echo $time | awk ' {split ($0,a, ":"); Print a[1]} ' # = 12Set sec = ' echo $time | awk ' {split ($0,a, ":"); Print A[3]} '
Script content:
Copy Code code as follows:
#!/bin/bash
For IP in ' cat ip.lst '
Todo
./ssh.exp $ip >/dev/null 2&>1
Done
nk= ' awk ' begin{bs=4000000}/access/{if ($1>bs) {Nk=nr-1;print nk}} ' Exp.log '
For NNK in $NK
Todo
Nodejs is really very hot, before the past, but never seriously recorded anything. Build its development environment under Ubuntu Try a quick, easy way to get the system to automatically help you install what you need, and we'll generate a shell
Today suddenly think of a problem has not hands-on practice, is the use of Shell batch modification file suffix, now hands-on practice.
Requirements: The home directory has some SQL files, want to bulk renamed into TXT
1, find + xargs +sed
Array as a data structure, in some high-level languages are directly provided and implemented, of course, my shell is also some ha.
PS: This article is written because brother B in the group sent a screenshot:
My big B elder brother is still
The recent systematic study of the shell function, the overall sense of the root of the other language function is similar, but it also has its own characteristics
One, the call function must be defined after the function, or it will be the error
When you write a shell script on a Linux operating system, we use the $ symbol in front of the variable to get the value of the variable, usually in the script using the "$param" in a double quote format, but there are also the use of the ' $param '
There are now port-proof tools, such as Psad, Portsentry, but feel the configuration is a bit cumbersome, and the server does not want to install an additional software. So I wrote a shell script to implement this function. The basic idea is: the
Especially in today's various browsers are flying (it is said that only IE is the kernel of the browser there are 200 kinds of).
Little brother today wrote a jquery based plug-in extension that identifies the type and version of the browser's kernel
What is a shell?
A shell is a special function program that is a interface between the core program (kernel) of the user and the Unix/linux operating system. Why do we say that the shell is an intermediary between the system's core program and its
We know that the registry is a very important part of the Win7 system, the registry is the same as the system of the database, the control of the entire computer data, it is important to say that the file in the registry, can not be arbitrarily
The IF statement determines which branch to execute by using relational operators to determine whether an expression is true or false. The Shell has three kinds of if ... else statements:
If ... fi statement;
If ... else ... fi
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