Two small shell scripts

Prevent other people from brute force password and deny this IP access to SSH service if someone tries to enter a password error number 5 times.#!/bin/bashlastb | awk  ' {print $3} '  | uniq -c | sort -r  > a.txtsed -ri  ' [email protected]^[[:space:

linux--Introduction to Shell

Here is a summary of some of the recent learning shell knowledge pointsBlog Park-Bang Bang sauce Good * * *1. What is a shell(1) The shell communicates the instructions we enter with kernel so that kernel can control the Jiyu hardware to work

Crawl specific fields in the Log shell script

Boss let me put the information in the log summary, good trouble, wrote this script to help work.Need to improve: 1. Crawl log time, only the last time, and this script will catch2. Requires two time difference (e.g. 15:23:34 and 23:23:34), not

Some shell commands that you learn and save yourself

Absrtact: In the process of learning, inevitably encounter some commands, the kind of need, but you do not have command. In order to save time, worry about forgetting these, special Open this essay, at any time to record some of the commands used.

Shell script extracts files recursively from folders

DemandThe first two days encountered the need to extract files in a folder of about 10 levels, and then wrote this script.A file structure such as the following: Dir1 ├──a │ ├──b │ │ └──file1 │ └──file2 ├──c │ └──d │

Shell Script Note 1

Finding mathematical expressionsVALUE=$[6/3]value=$ ((6/3))Let "value + = 1"Defining local VariablesLocal valuedefining integersDeclare-i valueCommand substitutionValue= ' Command 'value=$ (command)System variables$n, nth parameter$#, number of

Shell Script Note 3-looping

For List formFor variable in {list}do statementdonefor var in 1 2 3 4do echo $vardonefor var in {1..4}do echo $vardonefor v Ar in {start.. End.. Step}do statementdonefor i in {1..100..2}do echo $idonefor file in $ (LS) does echo

Shell modified file name (ii)

I want to modify the file name similar to the following batch of files:Aa01_01.txtAa01_02.txtAa01_03.txtAa01_04.txtModified intoBb02_01.txtBb02_02.txtBb02_03.txtBb02_04.txtReplace the head of the file name.============================================

"Shell" crontab command

I. Introduction of CrondCrond is a daemon that is used to periodically perform certain tasks or wait for certain events under Linux, similar to Scheduled tasks under Windows, when the operating system is installed, the Service tool is installed by

Shell syntax and tips-Continuous updates

1. String Qiatouquwei #,%For example:X=aabbaarealwwvvwwecho "${x%w*w}"Aabbaarealwwvvecho "${x%%w*w}"Aabbaarealecho "${x# #a *a}"Lwwvvwwecho "${x#a*a}"BbaarealwwvvwwWhere, # means pinch the head, because on the keyboard # on the left.Where,% is said

Pick up -4-shell in the flowers

IntroductionShell, we often use, with its powerful features, will help us solve a lot of difficult problems. Recently encountered a problem, to run a lot of case, assuming that the serial execution, it takes a long time. Can we get them to go

2>&1 Meaning of Shell programming

http://blog.csdn.net/gyanp/article/details/7258356It is often possible to find the following form of command invocation in some scripts, especially when Crontab calls/tmp/test.sh >/tmp/test.log 2>&1The first half of/tmp/test.sh >/tmp/test.log is

Shell scripts in Linux note the essentials

1: Errors in redirection and output are directed to the same file in the following way:such as:ls + 1>list.txt 2>&1 or ls + &>list.txtInstead of ls + 2>&1 list.txt2:-exec {} \; This is a command format, not a newline, there is a space in the middle

Shell script if, for, and while statements

(1) If statement[Email protected]:/mnt/shared/shellbox/shellif# cat shellif.sh #!/bin/bash# judgment string if ["$" = "Hello"]then echo "\$1= $ "fi# judgment number, if () mode can only be used under bash, not under sh if (>) then echo"

Executing shell commands/Scripts from Java code

There are two ways that the JDK comes with the runtime.getruntime (). EXEC () and Processbuilder classes, which are introduced after JDK1.5, and are also recommended by the authorities to abandon the use of runtime. Today in the implementation of

Algorithm----Hill sort (shell sort)

When analyzing the process of inserting sorting algorithm performance, it is known that when the array is small or there are more ordered subsequence, the insertion sort will finish sorting the array in a very short time, so you can design a

Replace the tomcat cluster war package with Shell scripts.

Replace the tomcat cluster war package with Shell scripts. Run the command to log on to the server without ssh. The configuration file does not change much to overwrite the previous configuration. Profile configuration file Bak =/home/wsm/bakWebapps

The Shell script calls a specified function through passing parameters.

The Shell script calls a specified function through passing parameters. When writing some functional scripts, we usually put functions with similar operations or similar parameters in the same shell script, which is convenient to manage, easy to

Shell loop, shellloop

Shell loop, shellloop1. LoopThe shell loop continues to execute a program until it meets the conditions. There are four types of loops: while LOOP, until loop, for fixed processing, and for numerical processing.2. while LoopThe while loop is

The Shell script calls the specified function by passing parameters. The shell script

The Shell script calls the specified function by passing parameters. The shell script When writing some functional scripts, we usually put functions with similar operations or similar parameters in the same shell script, which is convenient to

Total Pages: 541 1 .... 391 392 393 394 395 .... 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.