Some of the orders to be used in 2016/7/3 are recorded here, to be continued ...
2016/7/4 More ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View IP Address: windows:ipconfig/allLinux:ifconfig Ifdown disable the
The brackets inside the Shell (including the single and double brackets) can be used to test some conditions: arithmetic comparisons, such as whether a variable is 0, [$var-eq 0]. File property tests, such as whether a file exists, [-e $var], is a
Some special symbols.
$# the number of arguments passed to the script$* displays all parameters passed to the script in a single string. Unlike positional variables, this option argument can exceed 9$$ the current process ID number of the script
Strictly speaking, there is no concept of an expression in the shell. The shell itself is simply a collection of commands, and certainly not a bunch of random piles, but a certain organization. But this organization is not so rigorous, so this
A shell process is a process that executes other processes, but when a command is executed, the shell process instructs the kernel to execute the specified program separately as another process and write the output to the terminal. With the command
1. Array definition, the shell uses a pair of parentheses to represent the array, and the array elements are separated by "spaces"
# empty array arr1
arr1= ()
# array arr2, members are 1, 2, 3, 4, 5, 6
arr2= (1 2 3 4 5 6)
2. Array elements read,
In the shell programming process, you often encounter problems getting file names and file suffix names. The general processing methods are as follows:
#code
file= "Thisfile.txt"
echo "filename:${file%.*}"
echo "extension:${file##*.}
"
Basis
Spark's shell serves as a powerful interactive data analysis tool, providing an easy way to learn the API. It can use Scala (a good way to run an existing Java library on a Java Virtual machine) or Python. Start running in the Spark directory
In the company's intranet configuration cluster synchronization, may be a proxy problem, NTPD and chrony are not used, so had to write shell script to solvePrerequisites for each machine in the cluster has been configured with a password-free
1.Shell stringStrings are the most common and useful data types in shell programming (except numbers and strings, and no other type works well), strings can be in single quotes or double quotes, or without quotes.1.1 Single quotation marksStr= ' I
If Else judgment statement If statementSyntax Format 1:if condition then statement 1 Statement 2 ... Statement NFISyntax Format 2:Often used in terminal command prompt if [conditional];then statement; fi If Else statementSyntax format:if
Today, there is a very strange problem, the shell script that has been running very normal failed, but yesterday added a parameter.Error message:/bin/bash^m:bad interpreter:no such file or directoryLater found that root cause, modified the file
1. Process ControlShell script is a procedural programming language, the process of programming language is divided into three types of execution, namely sequential execution, select execution, loop execution, these three execution methods to build
Https://www.cnblogs.com/37yan/p/6962563.htmlCAUTION!!! If should is end with fiCAUTION!!! There should be a space between [and!, also between 1 and]1 ];then#!/bin/bash# Determine if the number of parameters passed in is not an if1 ];then echo
Common Linux directory names/The root directory of the virtual directory./bin binary Directory/boot directory. Store startup files/dev Device Directory/etc System configuration Directory/home directory, where Linux creates the user directory/lib
In general, we are the most common command for copying data on the same server is CP, which can be used if you want to copy between different servers.Now there are two servers, you need to migrate the files on the a server to B server, because the
Shell Basics
The first word entered in the command line must be the name of a command, and the second word is the option or parameter of the command. Each word in the command line must be separated by spaces or tabs. The format is as follows:$
If you do not use the built-in command but fork to output a sub-process and execute it in the sub-process, the path of the parent environment will not be changed.
After the execution is completed, it returns to the parent shell environment, and the
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