Shell script automatically pull black SSH login failed more than 3 times IP

#!/bin/bash#Created by T.sweetIptables_file=/etc/sysconfig/iptables #防火墙配置文件Ip_addr= ' Tail-n 500/var/log/secure | grep "Failed Password" | awk ' {print $11} ' | uniq-c | awk ' $1>= 3{print '#取出登录错误3次以上的IPCat $iptables _file | grep $IP _addr

Shell Programming-Regular expressions

1. What is a regular expressionIt is mainly used for string pattern segmentation, matching, finding and replacing operations.2. Regular expressions and wildcard charactersA regular expression is used to match a qualifying string in a file, and the

Shell command Merge Text

Before I wanted to print out the code, it seemed that, after merging, I found that there were more than 2000 pages in Word and then dropped the ~anyway, which was very useful.For example I have text A001.dat, A002.dat, A003.dat ... and then want to

The expr command in the shell

Expr can do the following:Logical operationsArg1 | Arg2 logic or operation, true return arg1, otherwise return arg2 (null or to determine the true and false parameters, there is a short-circuit function)Arg1 & arg2 Logic and operation, true return

Shell Simple usage note (Shell numeric operations) two

The value of the variable in the shell, if you do not specify the type manually, the default is the string type:For example:A=123b=456C= $a +#becho $cThe result is output: 123+456In the shell, if you want to perform numeric operations, you can do

The role of the character "&" after running commands in the Linux shell

Morning log in the server compiled to run the service-side program, learned that after the command after the character "&", quit the shell, run the command can continue to run. Puzzled the reason, and to search the following online, understand the

Linux Learning notes Basic bash shell commands

Linux File SystemLinux speaking files are stored in a single directory structure (virtual directory), and the virtual directory contains the file paths of all the storage devices installed on the PC.The more complex part of the Linux virtual

Shell Script--grep Tool

grep toolThe shell command line is convenient and the tools it supports are inseparable, and the grep tool is a search artifact that can search all the information in all the files in the entire Linux system.The flexible use of grep is inseparable

Shell script Application (iv)

The return status value of the shell environment based on the command execution ($?). ) to determine if the execution succeeds, when the return value of 0 indicates success, otherwise (not 0 value) indicates a failure or an exception. Using a

Shell scripts--string interception

If you want to intercept a string, you can do it by manipulating the subscript or pointer in C + +, and in a shell script, there are several ways to do this if you want to specify a string for interception:The following examples are used:str=

Shell----String interception method Induction

SHELL---string interception1, by the specified string interception (4 kinds) ${varible##*string} # to truncate the strings after the last string from left to right ${varible#*string} # to truncate the strings after the first string

The method of string interception under shell

One of the first few instances of the Linux shell intercepting strings, the first 8 bits are intercepted:The method is as follows: A=1234STERRERWRWRETW below1.expr substr "$a" 1 8           650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8

Shell script gets Zabbix monitor diagram

Because the leader put forward the need to see a few times a day the server traffic map, this morning 9 to start work, more than 10 servers, the designated time 12 hours traffic map, cut over the chart repeatedly control several times, one is afraid

Hive Shell Common Commands

Hive command Line Common commandsLoading dataLoad data local inpath '/home/ivr_csr_menu_map.txt ' into table ivr_csr_menu_map;Partitioned by:Load data local inpath '/home/lftest/lf1.txt ' overwrite into table lf_test partition (dt=20150927);Add

ArchLinux Shell Basic Learning

The first thing to know about scripting languages is that they are usually referred to as the parser for the command line interface. (from Wiki's explanation)Part I: Understanding the shellYou can see that #!/bin/sh and!/bin/bash are used here. But

Shell detects network status scripts for entire network segment IP by pinging

To achieve ping a network segment of all the IP, and detect the network connection status is normal, many methods can be implemented, the following is a brief introduction of two, as follows:Script 1#!/bin/sh# Ping Network segment all IPs# 2012/02/05

Shell Script Writing progress bar

Code:650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/82/D0/wKioL1dh_PjBg7laAABC2bcdSLE899.png "title=" Proc. PNG "alt=" Wkiol1dh_pjbg7laaabc2bcdsle899.png "/>Operating process and results:650) this.width=650; "src="

Make your own Linux-->shell

before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In

3rd Chapter Basic Bash shell commands

Start shellThe GNU Bash Shell provides interactive access to Linux systems. He runs as a regular program and usually starts when the user logs on to the terminal. When you log in, you start the shell based on the user profile/etc/passwd./ETC/PASSWD

Shell Crawler Simple Script (the number of threads can be controlled)

1. Introductiontake the home of Mechatronics website as an exampleafter the preliminary analysis, the electrical and mechanical Home data volume is large, and the data organization rules are more unified, suitable for code-based full-amount crawling.

Total Pages: 541 1 .... 309 310 311 312 313 .... 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.