The SED editor processes the file line by row and prints the output to the screen. The SED command reads the currently processed rows into the mode space (pattern spaces) for processing. When SED finishes all the commands on the line and prints the
To have a holiday, today is really idle egg pain, originally just want to write a configuration iptables script, did not expect to be so complicated by their own, or to share out to everyone, interested can change their own.PS: This script only
Infiltration using OPENROWSET to engage the shell
Get the SQL injection point, the first thought is backup Webshell, throw in NB run a lap, found that blocked the SQL error messages, not the physical path, that also wrote a PP horse.
Associated with
Day Fifth: Functions and task scheduling
Advantages of the function
Divide and conquer F
Work together
Easy Management
Easy Maintenance
Structure of the function
function functions name ()
{
Command 1
Command 2
Command 3
}
Parameter
A regular expression and wildcard characters
1 A regular expression is a string that matches the criteria in a file, and a positive one contains a match, and grep,awk,sed commands can support regular expressions
The 2 wildcard is used to match the
Objective
Here does not introduce git, table a see the command line is afraid, commonly used commands are these, basically meet more than 99% of the project needs, very practical.
Body
First, Common git command
1.1 Git clone []
From remote
Note: After the awk command, there are not too many complex commands, which are basic commands.
Description
Cat, which is the abbreviation of the word concatenate, outputs the contents of the file to stdout. When the redirection operator (> orWhen
Use here documentation
Copy Code code as follows:
#!/bin/sh
FTP-IVN 210.29.28.124 User Yun yun2011
Lcd/home/veyun
Cd/home/veyun/yhb
Get V
Bye
Eof
Explain:
-I: Turns off interactive prompts during multiple file transfers, so
The color of the text terminal can be generated using the ANSI non-normal character sequence. Example:
Echo-e "\033[44;37;5m ME \033[0m Cool"
The above command sets the background to blue, the foreground is white, the blinking cursor, the output
1 matching names with Pgrep
Copy Code code as follows:
if test $ (pgrep-f $ | wc-l)-EQ 0
Then
echo "process does not exist"
Else
echo "Existence process"
Fi
The following are supplementary content:Processes in the
Copy Code code as follows:
#!/bin/bash
#This the script is Usage for describle CPU Hard memery Utilization
Total=0
Idle=0
System=0
User=0
Nice=0
Mem=0
Vmexec=/usr/bin/vmstat
Which SAR >/dev/null 2>&1
If [$?-ne 0]
Then
Ver= '
Like the following text:ABCD 1234 FDS2011 5501023 832er 1231
The request is processed as follows:ABCD 1234 FDS2011 550total1:1023 Total2:832er 12end
Determine if the last line of text is preceded by the first column with Total1: The second column
DF, free disk, is used to display the disk usage of the file system. By default, the DF command will display all currently mounted file systems in each 1K unit, if you want to display the output of the DF command in a human readable format, such as "
Today, another Linux production environment to build. This is a lot of steps, very cumbersome and have to do things. Although many times, but there are many steps, orders do not remember, every time looking for information is troublesome, so take
In Java,python, you can use the import method to make calls between scripts or modules, for example:
Copy Code code as follows:
>>> Import Math
>>> Math.sqrt (4)
2.0
How do you invoke other shell scripts in the shell, or
First, debug scripts
Debugging is one of the important features that every programming language should implement, and when something unexpected happens, use it to generate the running information of the script, and the debugging information can
A question about how to automatically delete a specified file after it is larger than 1GB.The batch code is as follows:
Copy Code code as follows:
#!/bin/bash
# when the/var/log/syslog is greater than 1GB
# automatically back it up and
The LS command is used to display which files and folders are in the directoryLsBlue indicates folder White is fileLs-r List the contents of all folders (R = recursive)Ls-l View details including file permissions last modified time size (L for
Turn from:Shell Several methods for judging string inclusion relationshipsNow every time you analyze the site log, you need to determine whether Baidu Spider is a real spider, after nslookup need to determine if the result contains "Baidu" stringThe
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