in a production environment, it is possible that other administrators or users may modify Hosts.allow to allow more IP landing machines; In order to facilitate unified management, we can modify the Allow and deny files to the default settings when
By curl the-w parameter we can customize the output of the curl,%{http_code} represents the HTTP status code
The code is as follows
Copy Code
# curl-i-M 10-o/dev/null-s-W%{http_code} www.111cn.net
The above
Here's a simple shell program to illustrate.
debian:~/learn/shell# Cat Phonebook
Alice Chebba 973-555-2015
Barbara Swingle 201-555-9257
Liz Stachiw 212-555-2298
Susan Goldberg 201-555-7776
Susan Topple 212-555-4932
Tony Iannino
A few days ago I talked to a few colleagues about a problem: How do you pass an array to the inside of awk for processing in a shell script?
No way was found at that time. Two days ago in the QQ group to discuss awk, the conversation inadvertently
How to calculate the number of files and directories in the current directory
# ls-l * |grep "^-" |wc-l----to count files
# ls-l * |grep ' ^d ' |wc-l-----to Count dir
How do I just column subdirectories?
Ls-f | grep/$
For example, you might want to refer to the following implementation for a script that requires only sequential access to a resource, such as a disk file.
Copy Code code as follows:
#!/bin/bash
#
# File locking using Bash.
# ver 0.1.6
First, create a expect script ssh_expect, which reads as follows:
#!/usr/bin/expect-f
set hostname [lindex $argv 0]
set user [lindex $argv 1]
set passwd [lindex $argv 2]
s Et timeout
set force_conservative 1
if {$force _conservative} {
set
Simple Google a bit, not fruit, so sent an email for advice, and soon have a reply.
Copy Code code as follows:
Path = "C:\test.jpg"
arr = Split (Path, "\")
FileName = arr (Ubound (arr))
FolderPath = Left (path, Len (path)-Len (FileName)-
Sign up for a system service to boot from.
1 Script Authoring
#vim test.sh
Copy Code code as follows:
#!/bin/bash
#description: hello.sh
#chkconfig: 2345 20 81
exec_path=/usr/local/
exec=hello.sh
daemon=/usr/local/hello.sh
Shell version Nginx log spider crawl View script
Change the path of the Nginx log before usingIf more spiders themselves in the code Spider UA array Riga can
#!/bin/bash
m= "$ (date +%m)" Case
$m in
"") m= ' before ';;
") m= ' Feb ';;
"
Bash Script Programming:Case statement:Multi-Branch If statement:if CONDITION1; ThenBranch 1Elif CONDITION2; ThenBranch 2...else CONDITION; ThenBranch NFiExample 1: Display a menu to the user;CPU) Display CPU informationMEM) Display Memory
Reference documents:Summary of Shell interception string methods in LinuxHow does [Linux] calculate string lengths in shell scripts?There are eight ways to intercept a string, mainly for the following methodsThere are a number of ways to intercept
Script 1 Stop Lampp#!/bin/bash#set-XV Open debug mode?Count= ' Ps-ef|grep lampp|grep-v "grep" |wc-l ' # "" is the TAB key that holds down shift to appear ~ symbol, excluding the command count lines of grep itselfIf [$count-GT 0] # greater than one
The day after tomorrow to reply, today only brush a question, have not written out, but want to update the blog, so only to write the previous things posted out.A shell script for partitioning1 #!/bin/Bash #指定脚本解释器路径 2 echo "Initial a disk ..." 3
By default, Nginx access logs are stored in a file. After a long time, the log content becomes unusually large. It is not conducive to archiving, backup, and analysis of log files. You can run scripts on a daily basis to automatically cut logs and
On an online server, you do not know what operations have been performed. When you log on to the server,-bash-4.1 # does not display the path. So I searched for a solution on the internet. The following solution can solve the problem:Vim ~ /.
Nginx does not support using cronolog to rotate logs like Apache, but you can use the following methods to cut log files:Mv/data1/logs/access. log/data1/logs/20111030.logKill-USR1 Nginx master process numberUse the mv command to rename the log file
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