Ideas:
1, back up yesterday's log, while deleting the five days before the backup data.
2, copy the log file, and set the original log file is empty
Shell
#!/bin/bash
#function: Cut nginx log files
#author Kung
log_path= '/home/wwwlogs/'
Echo is similar to the LS command. Many functions can be implemented through regular expressions.
For example, we can use echo. * To display all the files under the current folder, but by using echo-d. [!.]? * You can remove the current
1. First, write a simple shell script
Vimtest.sh (Nano is not used to use VIM)
Enter Vim and press the I key, then enter (#!/bin/sh symbol #! to tell the system that its subsequent parameters are the program used to execute the file.) )
The average time complexity of hill sort is O (nlog2n), Space complexity is O (1), time performance between O (n^2) and O (nlog2n). Hill sort is an unstable sort method whose performance can be fully played in the number of records to be sorted.
The
1) Count the number of rows in the index.php file in the current directory[[email protected]_web1 ~]# cat index.php |wc -l172) Statistics web directory, JS file number:[[email protected]_web1 ~]# find web/ -name "*.js" |wc -l3) Statistics web
1 Create a good conversion under Windows and place it under one of the Linux folders. such as: Put the 0816_em.ktr file under the/home/cfj/kettle/testdemo.Note that the database user name and password may need to be changed if it is a job file such
In shell scripts, variables are divided into two types, system variables, and custom variables.System default variables are some of the system's own variables, such as PATH variableUser-defined variables are some of the variables that you define
guess the number game. First let the system randomly generate a number, give the number a range (1-60), let the user enter the guessing number, the input is judged, if not meet the requirements, give high or low hint, guess the right after the
In the project you need to train in a batch of new datasets with the same format, without having to copy the new data set to the original training data directory, and simply create a link to the new data file in the original training data
System variables, display all variables of the current shell set reference variable $ plus variable nameGlobal variable: Export variable nameAssign the return value of the command to the variable: a= ' ls-la ' inverted quote equals a=$
1. RequirementsServer Master Agent Envtype8.0.0.1 8.0.0.11 8.0.0.111 AAA8.0.0.1128.0.0.12 8.0.0.1138.0.0.1141. Get the list of machines in the document/etc/ansible/hosts[Server][Master][Agent]2. contract to target Machine2.1 Send flask to all
Beginners, do not consider the good-looking, high efficiency is not high! Need to meet the needs first! Demand is the first place!grep, SED, awk. Three Musketeers!Learn the shell, need the premise!1.linux System Command Proficiency2. Figure out the
Shell Secript:Differences in execution modes:The./sh execution is performed in the creation of a subroutine that only inherits the environment variables,If the export declares that the subroutine's subroutine will inherit, it will not be promoted to
List of special variables
variables
meaning
$
File name of the current script
$n
Arguments passed to the script or function. N is a number that represents the first few parameters. For
Today I received a request that a string be included in the result of the script execution and asked to find out.The idea I gave was to write the text in an appended way according to the name of the script and the result, and then find the
In shell programming, operators are essential, and can be said to be used in every script. Familiarity with mastering operators is a basic skill.
Comparison operators:
eq
Equals
Ne
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