#/usr/bin/env Bash
# Name:get_network_info.sh
# author:purple_grape # This was
a script to gather network inf Ormation of your Linux system.
# Test under Ubuntu 10.04 only.
#----------------------------
nic=eth0
mac= ' lang=c ifconfig $NIC | awk '/
1. Take today's time
Copy Code code as follows:
$date-D "Now" +%y-%m-%d
2. Take yesterday time
Copy Code code as follows:
$date-D "Yesterday" +%y-%m-%d
$date-D "1 days ago" +%y-%m-%d
# # D,--date=string
Unlike Java, PHP and other languages, the process control of SH is not NULL, such as:
Copy Code code as follows:
if (Isset ($_get["Q"])) {
Search (q);
}
else {
Doing nothing
}
?>
You can't write this in Sh/bash,
The following script can count the total number of visits to the site and how many times 404,500 occur. Statistics, we can combine the monitoring of the Bora record, and then you can see whether the site traffic anomaly, whether there is an attack,
[SED Introduction:]
Sed is a good file processing tool, which itself is a pipe command, with the Behavior unit processing, can be used to add, select, replace, delete data rows and other operations.
SED command line format: sed [-nefri] ' range
Job Four:
Write a script:
Implement Ping Class C network segment, Class B network segment and all hosts in Class A network segment;
The network segment address lets the user input, moreover uses the script to judge the network segment type;
This article mainly describes the shell script in the execution of SQL statements 5 ways to operate MySQL, this article explains the SQL statement embedded directly into the shell script file, the command line calls a separate SQL file, using the
1. Conditional selection: If statement① Single Branchif judgment condition; then condition is true Branch code FI② Dual Branchif judgment condition; Then condition for true Branch code else condition for false Branch code FI③ Multi-Branchif judgment
Source: "Learn Linux with old boys" shell programming combatInterview Question 1: mass production of random character filenamesCode:[email protected]:/home/dell/shell# vim creat_ten_htmlfile.sh #!/bin/bash#date:
"Thedifference between the login shell and the Non-login shell "
Login Shell: A full login process is required to go to bash. That is, by entering the account and password to log into the system, the obtained shell is called the login shell
1. Gets the return value of the Shell function call:#!/bin/sh info () { cat jlb.sh} res= ' info ' echo ' state: ' $?echo ' res: ' ${res}description : res='info' This behavior calls function info, inside the symbol ' is not a single argument,
The script reads as follows:-------------------------------------------------------------------------------------------------------#!/bin/sh#定义变量secs=3600Unit_time=60stepts=$ (($secs/$unit _time))echo CPU usage ...;For ((i=0;iDoPs-eo COMM,PCPU |
Dynamically analyze Maillog logs with shell scripts to disable malicious IP firewallSystem environment: Centos 6.5 x64Postfix mail system installed, found Maillog too many "SASL LOGIN authentication failed" Junk IP address. This script is used to
Directory one, what is shell script two, variable three, operator four, flow control five, function first, what is shell scriptStacking OS commands into executables, executing the OS commands in the text from top to bottom, is scripting, and with
The security and stability of the server is the goal that every operation and maintenance want to achieve, after all, once the website traffic is big, access is high, there will be some boring people to attack, to help detect the vulnerability is
Move cursor shortcut keysCtrl+f move forward one characterCtrl+b Move backward one characterCTRL + A moves to the beginning of the current homeCtrl+e move to the end of the current lineAlt+f move forward one wordAlt+b Move backward One wordCtrl+l
The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and
Transfer from http://roclinux.cnThis original article belongs to "Linux greenhouse" blog, the blog address is http://roclinux.cn. The author of the article is rocrocket.===[Start of body]Sometimes learning scripts, you will find the sort command
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