Analyzing Nginx Access Logsawk ' {a[b[$1]++]}end{for (I=length (a); i>0;i--) for (j in B) if (b[j]==i) {c++;if (c ' Www.dwhd.org_nginx.logThe effect is as followsSort statistics in reverse orderCat Access.log| Sort| Uniq -c| Sort 1 -n-rUniq only the
when executing a Shell script, parameters can be passed to the script, and the format of the parameters obtained in the script is: $n. n represents a number, 1 is the first argument to execute the script, and 2 is the second parameter that executes
First, the history of the command linePress up and down to traverse the most recently entered command after entering incremental modeThis can be viewed in the previous 2000 history$ vim ~/.bash_historySecond, edit the command line
: Delete the
For In loop statement#!/bin/bashfor x in one three Fourdo echo number $xdoneExample: Remove each line in the passwd name and output Hello + name#!/bin/bashlines= ' Wc-l/home/eko/passwd | Cut-d '-f1 ' for I in ' seq 1 $LINES ' Do echo '
Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help information①/ETC/PASSWD (Hint: View this file description description via man 5 passwd)②/etc/shadow (Hint: View this file description
Deny remote illegal users with SSH brute force login server. Once you enter the password error four times, directly deny the host IP login.The script is as follows:
#!/bin/bash#auto Deny SSH error IP#author is Lingshu#2018-04-30#########
| The operator pipe symbol is a very powerful feature of UNIX, and the symbol is a vertical bar: "|".Usage: Command 1 | Command 2 His function is to pass the result of the first command 1 execution as input of the Command2 to command
How do you implement a shell-like command to assign a value to a variable under bat?At first, it was really hard for me. With the familiarity of bat batch knowledge deepened.Learning to!!!Give me a chestnut:Svnlook UUID C:\Repository\test # What do
/ETC/PASSWD Purpose: This directory stores the operating system user information, which is visible to all users. Consists of 6 semicolons consisting of 7 information, user name, password (encrypted), UID (user ID), GID Group ID, user's full name or
Learning Environment: Ubuntu How to view the system version: [# Cat/proc/version]1. For loop Practice 1.1 batch generate random character file name caseExperimental purpose: Generate 10 randomly generated txt text under the/learning path, and the
First, alarm system mail engine[[email protected] mon]# lsbin conf log mail shares[[email protected] mon]# cd mail[[email protected] m ail]# vim mail.py//Create send mail script #!/usr/bin/env python#-*-coding:utf-8-*-import os,sysreload (SYS)
First, Shell introduction1, the shell is a command interpreter, providing users and machines to interact, each user can have their own specific shell,2, CentOS7 default shell for bash, and Zsh,ksh they have the difference in detail,We can check if
8.1 Shell Introduction: Can be divided into interactive and batch processingInteractive: The user executes a command every input immediatelyBatch: The user writes the full shell script in advance, and the shell executes many commands of the script8.2
A variable in a shell script means that the command itself can represent a soft connectionShell variablesParentheses can only affect variables in parentheses because the parentheses open the child shellCurly braces affect variables outside the
1, shell command commonly known as "shell", it provides a user interface with the kernel to interact with, he accepts the user input command and sends it to the kernel to execute 'The shell is actually a command interpreter that interprets the
Judging command testYou can use the test command to perform tests on files, strings, and so on, typically with control statements such as While,if,case"字符串测试" ? test str1==str2 测试字符串是否相等 ? test str1!-str2 测试字符串是否不相等 ? test str1 测试字符串是否不为空 ? test -n
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