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
Linux must use the Linux shell command . Nonsense! You don't know any Linux commands , such as Ps,grep,ls, but you can still use a lot of modern Linux desktop distributions.
Linux system administrators are not like desktop users, they don't
This article mainly introduces 4 methods of executing the shell script and the difference introduction, this article explained the relative path way, the absolute path way, the Bash command call, the relative or the absolute way as well as the next
Shell Script
Just do it, simply write a Shell script and it's done!
Script Name: Web site dead chain generation script
Script function: Daily analysis of the site the day before the Nginx log, and then extract the status code of 404 and UA for
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
This article mainly introduces the variables in the shell use summary, this article summed up the variable syntax, common use forms and so on, and give the code examples, the need for friends can refer to the
The definition of a variable can only
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. Introduction to the function1. Put the deleted files in the Recycle Bin2. Recovery of deleted files3. Implementation of the Linux RM command function, using almost the Linux system with the RM, command exactly the same4. New features: Rm-l, RM-E,
One, variable operation
A. variable display, printSyntax: Echo $varB. Variable settingsSyntax: Var=value
Setting rules for variables:1. Variable ends cannot be directly connected to spaces2. Variable names can only be letters and numbers, but the
Description: Everyone at ordinary times to Linux server security is mainly to the system user inspection, landing server IP check, as well as firewall status check!
1. You need to store the correct system username in
One, the difference between NR and FNR
NR: Represents the current number of recordsFNR: Also represents the current number of records, but the scope of FNR is within only one file. If you reopen the file, FNR starts at 1.
Second, the example
The percentage of CPU, memory usage of the process seen through the top command is a floating-point number, and I need to process it while writing the script, so I learned a few things and summarized as follows.
In fact, the Shell (here is bash)
A regular expression is a literal pattern consisting of ordinary characters (such as characters A through Z) and special characters (called metacharacters). This pattern describes one or more strings to be matched when looking for a text body. A
Job Four:
Write a script:
Implement Ping Class C network segment, Class B network segment and all hosts in Class A network segment;
The network segment address lets the user input, moreover uses the script to judge the network segment type;
A few days ago, in the process of discussing a statistic on the number of scripts being executed on Cu, I found myself ashamed of how little I knew about how the shell executed the command ... During the period get Waker brother's advice, thank you
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
1.HBase Shell and we use the MySQL terminal is a means, such as we installed MySQL, CONFIGURED environment variables, command line input mysql-uroot-p password can be directly into the MySQLThe terminal, where HBase is also a meaning.How to enter
When analyzing a complex script, it is sometimes necessary to pause, in a segmented view, to be more clearSo the reference to some of the implementation, the current own use is such a son#add forDebug by ZqbfunctionGet_char () {Savedstty= ' Stty-g '
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