This article mainly introduces the shell script implementation based on SVN Code submission Statistics tool, this article directly gives the implementation of script code, the need for friends can refer to the
Nothing recently, I wrote a code
This article mainly introduced the introduction of Linux in the CP and MV Collocation {,} in the use of the shell, the author cited four such braces to expand the example, the need for friends can refer to the
Often see commands like the following
Loop statements are often used when writing shell scripts. Here a simple summary of the commonly used 3 kinds of circular statements, so that later can quickly reference to write, nonsense do not say, start Demo:
1, for
Used mainly for:
Uptime command:-* Use the uptime command to get host run time and query Linux system load information. The information is displayed in the following order: Now time, the system has elapsed time, the current number of landing users, the system in the
In order to more easily know the memory usage on the server, and according to the memory use size to restart the service, I only the whole fault alarm, if you want to automatically restart the service, we will have to modify their own.
Script
Du command
Disk Management
The du command also looks at the usage space, but unlike the DF command, the Linux du command is a view of the space used by files and directory disks, or there are some differences from the DF command.
Grammar
du
If you manage more sites and servers, every time you modify a configuration file, it's pretty painful. The idea is to use a shell script to generate bulk configuration files and configuration data. The following script is a shell script for batch
A start to build the Chinese blog Alliance, both bloggers remind me to do Web site Daquan maintenance of this kind of website is very troublesome, need a lot of energy to debug some of the aborted site, but also to take the blog Encyclopedia of Pine
1, the use of rules
Awk is suitable for text processing and report generation, and it has a number of well-designed features that allow you to program programs that require special skills.awk syntax is more common. It draws on some of the best
Thread classification
Threads can be divided into user-level threads and core-level threads according to their dispatchers.
(1) user-level threadsThe user-level thread mainly solves the problem of context switching, and its scheduling algorithm
1. Preface
In the actual development process, each module will involve some common functions, such as reading and writing files, search, sorting. In order to reduce the redundancy of the Code and improve the quality of the code, these common parts
Script requirements are as follows: This shell script is placed in the Crontab planning task, every 6 hours (this time according to the actual situation) to read the/var/log/secure script, take out the malicious guessing IP, if the unit time (a week)
Demo Effect:
1, the first level menu
2, Level two menu
3. Perform operation
Script reference:
Copy Code code as follows:
#!/bin/bash
#author Lic (Oldboy Linux student)
#date 1304
disk_no= "/DEV/SDA1"
Nginx_dir= "/usr/local/
It is customary to use the Linux command line to manage Linux systems, for example:
Copy Code code as follows:
$ date
211 01:34:58 CST 1999
$
When the user logs in, it actually goes into the shell, and it follows a certain
The Linux shell is much more powerful in programming than in Windows batching, whether in cycles or operations.
Bash supports one-dimensional arrays (multidimensional arrays are not supported) and does not qualify the size of the array. Similar to
Title: Write a shell script that uses ping to determine whether the host in the specified IP or IP side is alive.
Accept only the specified IP format input and IP segment input (for example: 192.168.2.88 or 192.168.2.) Note that there is a point
The Unix command obtains input from the standard input device (stdin) By default, outputting the result to the standard output device (STDOUT) display. In general, the standard input device is the keyboard, the standard output device is the terminal,
1) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the file (arg1) to the destination address (ARG2)./copy.sh file1.txt/tmp/Cat copy.sh#!/bin/bashcp $1 $22) How to calculate the parameters
In order to prevent the server from being subjected to SSH brute force hack, will attempt ssh brute force hack this machine more than 10 times of IP to seal off, prohibit its landing this machine!#!/bin/bashCat/var/log/secure |awk '/failed/{print $ (
An error occurred while executing the script in Ubuntu system "Source command not found in sh shell"This is actually a script that executes in Ubuntu by default with dash, not bashby command#LS -l 'whichsh/bin/sh --dashWe found that the SH used by
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