Shell Script-Nginx startup script

Os:centos/redhat Seriesand tested properly on CentOS 6.7 and CentOS 7.2#!/bin/bash## auth:daxin# time:2018/07/10## nginx start Nginx Web server# # chkconfig:-90# Description:start, S Tops and reload Nginx Web server##

Quoting in the shell

The quoting (reference) in the shell can be used to remove the special meaning of a character so that it retains its literal meaning and can be used for a variety of shell Expansion.There are 3 kinds of quoting mechanisms: escape characters, single

Links between Makefile,shell Command,shell Language

1. MakefileThe first thing to know is what Makefile is, Makefile is a directive file, which stores custom commands (which can be created with the help of existing commands), and differs from Makefile in different systems, linux/ In UNIX systems, the

Shell Advanced Programming

Conditional Select if statement 选择执行: 注意:if语句可嵌套 单分支 if 判断条件;then 条件为真的分支代码 fi 双分支 if 判断条件; then 条件为真的分支代码 else条件为假的分支代码 fi 多分支 if 判断条件1; then 条件为真的分支代码 elif 判断条件2; then 条件为真的分支代码 elif 判断条件3; then

Shell Daily Script

1. Use a command to find the files that have been modified in the last 24 hours in the/etc/directory, and the suffix name isthe. log file and delete it.Find/etc-type f-mtime-1-name "log* "-exec rm-rf {} \;2. From the Test.log file, find the row

Methods for referencing shell variables in awk code

A fragrant chestnut is better than words#!/bin/bashfoo= "Good" # Without spaces bar= "Hello World" # with spaces awk ' BEGIN {print ' $foo ' "; "'" $bar "'"} 'The pest above maintains the usual practice of enclosing the awk code in single

Linux kernel optimization related shell script

#修改 some of the default configurations in the/etc/sysctl.conf fileif [grep -v "^\s*#" /etc/sysctl.conf|grep -c "net.ipv4.ip_forward\s\+=\+0"];thenCat >>/etc/sysctl.conf Net.ipv4.ip_forward = 0Net.ipv4.tcp_max_tw_buckets = 5000Fs.file-max =

Debugging and computing in the shell

2. Correct method1) Use LetVar=1Let "Var+=1"Echo $varThe output is 2, no tragedy this time.Attention:A) I tested let almost support all operators, see an article on the internet said "let does not support + + 、--and comma, (,)", but after I test the

Shell Basics (1)

Shell Basics1.shell is the intermediate medium used when the system interacts with the computer hardware, and he is a system tool. If the computer hardware analogy to the human "body", the system kernel is the human "brain", the shell is the "five

Tomcat multi-instance one-click Deployment Shell Script

#!bin/bash#tomcat deployment script, upload apache-tomcat-8.5.30.tar.gz, jdk-8u172-linux-x64.tar.gz to the server's/tmp/directory in advance. Install Jdktar  -zxf /tmp/jdk-8u172-linux-x64.tar.gz -c /usr/local/ln -s /usr/local/jdk1.8.0_

Shell script: Add new rows to another file

#!/bin/bashCd/usr/local/logstash/nginxlog[-F Num.txt] | | Count=0[-F Num.txt] && count=cat num.txtNcount=wc -l /var/log/nginx/access-app.log | awk ‘{print $1}‘echo $ncount > Num.txtFor ((i= $count +1;iDoNum=$[i]plog=sed -n $num /var/log/nginx/access-

Shell script case (i) batch create user

Case requirementsBatch build Linux users with shell scriptsImplementation requirements: Create user student1 to Student50, specify Group as student group! And each user needs to set a different password!Implementing scripts#!/bin/bashgrep ‘student‘ /

Scrapy knowledge supplement--scrapy shell and Spider

What is a scrapy shell?The Scrapy terminal is an interactive terminal that allows us to try and debug the code without starting the spider, or to test XPath or CSS expressions to see how they work and to easily crawl the data in the page.Selector

Shell Programming Notes

View Catalogawk ' {if (!system ("test-d")) print $} 'Batch Quick Create user for in user{0.. Ten Do useradd $i echo123456passwd --stdin $i DoneUse the IF statement to determine#!/bin/bash# file Judgmentif[-E $1]; Then Echo "File

Shell Programming (i)

Variable:1. Variable declaration eg:#:name= ' EKO '#!/bin/bashMyurl="http://www.w3cschool.cc"readonly myurl / /declare read-only variables2. Variables using eg:#:echo $name #: Echo ${name} 3. Delete variables eg:#: Uset Name4. Variable type:

Five, Shell operations

Integer numeric Operations use the expr command: You can only do integer operations and return the calculation results by default Format:Expr integer 1 operator integer 2 ...Integer values can be supplied with variables, giving the result of the

"Shell combat" executes commands on multiple servers in bulk

Function Description: Execute commands on multiple servers in bulk1 #!/bin/bash2 3 # ==========================================4 #function: Execute commands on multiple servers in bulk5 #method:./batch_cmd_manager.sh 6 #return: List of results

Shell Script Basics (v)

First, the alarm system main script[[email protected] ~]# cd/usr/local/sbin/# #脚本基本都放在这个文件夹下, convenient management [[email protected] sbin]# mkdir mon## Create a monitoring script home directory [[[email protected] sbin]# CD mon[[email protected]

Shell Script Basics (vi)

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)

8.1 Shell Introduction 8.2 command History 8.3 command completion and alias 8.4 wildcard 8.5 input/output weight

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

Total Pages: 541 1 .... 402 403 404 405 406 .... 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.