Often read some of the books about Linux still feel unable to fully grasp this knowledge can not be fully mastered as long as you can achieve proficiency in the use of after all, do research and development is able to quickly make products to sell
How to use:./spark-script. sh your_file.scala first_arg second_arg third_argScript :scala_file=$1Shift 1arguments=[email protected] #set+o POSIX # To enable process substitution if not running on bash spark-shell--master Yarn--deploy-Mode
There are several ways to bash a shell script, and now make a summary. Suppose we write a good shell script with the file name hello.sh and the file location in/data/the shell directory and has execute permissions. Method One: Switch to the
Function: Extract various fields from the output of the input file or commandUsage: cut–c{string range}–d{field separator}–f{field index number}Example:(1) View online users: Who | Cut–c1-8(2) List of user names obtained from System file/etc/passwd:
Hadoop shell command operation, enter the Hadoop carriage return can be found:The commonly used commands are:Hadoop Namenode-format This is the command used to format the file system before starting Hadoop.Hadoop Dfsadmin This is the management
Operations, shell scripts often encounter the legitimacy of determining the value entered, such as IP, email address, and so on. Then, according to their own script to summarize the judgment of IP legitimacy script to share to the netizen, when
1. What is BashIn Windows systems, the most common use of a graphical interface is to perform performance. Sometimes we also use DOS commands to execute commands, where DOS is a text-mode interface, and we have some DOS instructions that can be done
Instance one: monitors the specified file status in the mounted directory, polls for one second, and the file is updated to be taken to the specified directory.1 #########################################################################2 #File
String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.The code looks like this: Echo ${var#*//}where Var is the
One. HDFs shell commandWe all know that HDFs is a distributed file system to access data, then the operation of HDFs is the basic operation of the file system, such as file creation, modification, deletion, modify permissions, folder creation,
The shell can often be seen: >/dev/null 2>&1/dev/null represents an empty device filewhere does the > delegate redirect to, for example: echo "1111" >/home/a.txt1 means stdout standard output, the system default is 1, so ">/dev/null" is equivalent
[ -a file] is true if file exists. [ -b file] True if file exists and is a block special file. [ -c file] True if file exists and is a word special. [ -d file] True if file exists and is a directory. [ -e file] is true if file exists. [ -f file]
The replacement function of SED is quite similar to the VIM syntax.Replace 1 to 10 rows of Nologin with login[[Email protected] ~]# sed ' 1,10s/nologin/login/g '
Special Symbol:&&Note: Also, the left and right sides are two commands, the execution on the left will only execute the command on the side. RightSpecial Symbols: | |Note: Alternatively, the left and right sides are two commands, the command on the
Shell Script IShell There are two ways to execute a command:
Interactive (Interactive): Explains the execution of a user's command, the user enters a command, and the shell interprets the execution of a single rule.
Batch: The user
Compiling Java projects is generally straightforward with the IDE or with tools such as Ant and Maven, and few people use pure shells to compile Java projects. Just meet such a should, use this blog post to make a record.Case: I wrote a Java project
Specify an array for a characterHow to display an arrayA=1echo $a1A= (1234) echo $a1echo ${a[@]} 1 2 3 4echo ${a[*]}1234Specifies the number of digits in the display arrayecho ${a[0]}1echo ${a[2]}3echo ${a[3]}4Echo ${a[4]} spacesAdd arraya[4]=9echo $
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