This article mainly introduces the shell script to determine whether the IP address in an IP segment code sharing, this article directly to the implementation code, the need for friends can refer to the
?
1 2 3 4 5 6 7 8 9 10 11 12 13 1
This section describes several shell scripts that can be used to extract I/O information from the disk, system load load information, and so on
1, extract the system load information
Copy Code code as follows:
#!/bin/sh
host=$ (hostname)
This article mainly introduced in the shell for And while loop detailed summary, this article explained for the For Loop's digital section form, detailed lists, to the file circulation, while loop's three kinds of use situation and so on content,
This article mainly introduces the shell commonly used operator Summary, this article explained the arithmetic operator, the relational operator, the test operator and so on content, needs the friend to be possible to refer to under
First, the
The waste CPU opens the shell to open the process.
1. Preparation work
2, this step with a knife when you must be careful to be patient, do not scratch the CPU cover and the following section, do not be afraid of no place to row, the
I/O redirect Detailed and application example
1, the basic concept (this is to understand the knowledge behind the premise, please be sure to understand)
A, I/O redirection is usually related to FD, Shell FD is usually 10, namely 0~9;
b, commonly
1. Single File read
Under the shell script, you can read files by rows in a variety of ways, as follows:
For line in ' Cat ${input_filename} '
Todo
Echo $line
Done
While Read line
Todo
Echo $line
Done
The second way is to redirect files
Script Writing backgroundWhether it is a production environment, a test environment, or a development environment, it is often necessary to use the RM command to delete & batch files in some "important" directories. According to the philosophy of
Typically, as a deployment script for an application, the first task that starts is to create a dedicated (dedicated) user and user group for the current app. This script is very easy. Here is a sample of references:#!/bin/shuser=test_usergroup=test_
Shell script automatically adds black malicious attack IPSystem environment: Centos 6.5 X64If we open the SSH 22 port to all the users, then we can see in the/var/log/secure file, where the face is full of malicious attacks of IP, then how can we
This article focuses on the parts of the bash script that are prone to errors and rarely used but have unexpected effects.Cycle:Normal for loop: for inch a B C 1 2 3 do Echo " $i " DoneNumber sequence loop: for in 'seq-do- echo'$i'done The '
1. Cron Service "Ubuntu environment"
2. Crontab usage
3. Edit the Crontab file
4. Process examples
5. Several examples
In Linux, periodic tasks are typically handled by the Cron daemon . Cron reads one or more configuration files that
Read Catalogue
1. Cron Service "Ubuntu environment"
2. Crontab usage
3. Edit the Crontab file
4. Process examples
5. Several examples
In Linux, periodic tasks are typically handled by the Cron daemon . Cron reads one or more
The test command has three types of test expressions, the first of which is the comparison of numeric values, the second is the comparison of strings, and the third is the testing of files, such as testing the existence of a file.1. Numeric test ,
#/bin/bashBefore you start the shell script, be sure to add the above sentence at the beginning of the script and write it with your head, without spaces and blank lines ahead of you. This means telling the system which shell to use to execute the
I. Source of the problemSometimes copy some important data, and then need to check with the original data whether the data is consistent. This requires a checksum.Two. Analysis of the problemThere are several ways to verify the data, and the
Method 1:Monitoring disk or CPU exceeding a certain value mail alert script:[email protected] scripts]# cat check.sh#!/bin/bashLang=en_us. UTF-8cpuused= ' Top-n 1|awk-f ' [,%]+ ' nr==3 {print100-$11} 'diskused=$ (df-h|awk-f ' [%]+ '/\/$/{print $}
A. Shell command1. Enter the HBase command line./hbase Shell2. Display the list of tables in HBase3. Create a user table, including info, data two column familiesCreate ' user ', ' info ', ' data 'Create ' user ', {NAME = ' info ', VERSIONS = ' 3 '}4
The first question: how can I pull my local warehouse code to the GitHub site?Git push Origin masterwarning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.To Github.com:lanshanxiao/yunweather.git! [Rejected] Master--
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.