Prepare 3 Machines1.linux-node1 ip:10.89.3.108 (Springboard machine)2.weblamp ip:10.89.3.1003.weblnmp ip:10.89.3.101The 3 system environments are as follows:[Email protected] ~]$ cat/etc/redhat-release CentOS release 6.8 (Final)1) First do SSH key
Personal configuration is mainly concentrated in the ~/.profile file.When you open a new interactive shell, the order in which the configuration files are executed is/ETC/PROFILE/ETC/BASHRC ~/.profile and finally ~/.BASHRCEnvironment variables--can
First we need to understand the content and format of the script
The first line must be shebang (interpreter path), shebang must occupy the absolute beginning
In the shell script, except for Shebang, the contents of the line beginning
First we need to understand the content and format of the script
The first line must be shebang (interpreter path), shebang must occupy the absolute beginning
In the shell script, except for Shebang, the contents of the line beginning
2.1.1 Parameters for shell scriptsCommon parameters(1) * A string to display the parameters passed to the script, and the location variable, this parameter can be more than 9(2) @ start at parameter 1, show all parameters passed to the script, and
As a participant in a large open source community, or rather as a member of the Fedora project, I have the opportunity to meet with many people and discuss various interesting technical topics.My favorite topic is "command line" or shell, because
I. Introduction to Linux Shell1. Shell overviewThe shell is an interface that the user interacts with the kernel, and the most popular shell is now called the Bash shellThe shell is a programming language The Shell is a scripting language, so you
Automatic deployment, initial configuration, and start of Nginx reverse proxy service, automatic deployment, initial configuration, and launch of two Web#!/bin/BashYum InstallEpel-release-yYum InstallNginx-yPSAux |grepNginx |grep-V'grep'if[$?-ne0 ]
Homework One: awk, the collation of variablesawk Syntax:-F defines the field delimiter, and the default delimiter is a contiguous space or tabUse the order of $1,$2,$3 to represent the different fields of each row in files separated by the interval
Job One: organize regular expression BlogsJob Two: grep jobs (regular expressions and character processing)Target file/etc/passwd, using the grep command or Egrep1. All rows containing root are displayed:2. Output any rows that contain bash, and
In writing shell scripts, we need to use a variety of special symbols, through these special symbols can make the code we write more concise and efficient, here are summarized below:1. {} curly braces:Usage One: Wildcard extensionEg:ls
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
Frequently used file test operators-ongoing updates
- e -- exist
File exists is True
- F -- file
File exists and is true for normal files
- D -- Directory
File exists and is directory-True
The following 1.log files are counted,Requirement: What is the number of visits per IP? Prompt, awk filters out the IP first, then sorts, counts the repetitions. You can use just one commandawk ' {stat[$1]++}; End{for (A in STAT) print Stat[a], A} '
Variable: Stores the memory space of a single element;Array: A contiguous memory space that stores multiple elements;Array name: The entire array has only one name;Array index: numbering starting from 0;Array name
Before writing a shell script, you need to automatically create 1-100 of the text without knowing how to create it. Baidu finally know the way to create.There are a lot of ways to create 1-100 in a shell script, so I'll say two easy-to-understand
There are many ways to open the file, but I learned that the use of more is the above--, in order to prevent forgetting later, the first to write down the understanding.1. ShellThis read a lot of web pages, the most reliable way to use:Shell ("" " )
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.