1. First, write a simple shell script
Vimtest.sh (Nano is not used to use VIM)
Enter Vim and press the I key, then enter (#!/bin/sh symbol #! to tell the system that its subsequent parameters are the program used to execute the file.) )
The average time complexity of hill sort is O (nlog2n), Space complexity is O (1), time performance between O (n^2) and O (nlog2n). Hill sort is an unstable sort method whose performance can be fully played in the number of records to be sorted.
The
Shell in the large data domain is an essential tool, how to learn how to use a good shell, start with a simple command
If [-Z "$DIRNAME"] what does this-Z mean?
File operations like this are useful in shell programming: I've summed up some of
In the previous article, we had a simple reference to the pseudo code of the shell or Python dispatch hive, and today we are enriching the pseudocode
http://blog.csdn.net/haohaixingyun/article/details/51821444
Note that in the actual production
Find command: Search for files in specified directory
commonly used option:
-name: Specify the filename, or use "*.py" to specify the suffix name of the file, such as searching all the py files under the/home directory
Find/home-name ' *.py '
Spark-shell-Initiated problem solving
Today in the start of the Spark-shell model of the wonderful appearance of the following several problems
1 Port occupancy: 4040 Port is occupied, we know that 4040 is the worker's port use, but is occupied, as
What does it mean in the shell that we will see the symbols of $ , $, and $? Simply put is the name of the shell script that you wrote, the first parameter you wrote to your shell script, and the second parameter that you wrote for your shell script.
If the file is a. css file or a. js file, it is processed.file=$1if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then do somethingfiAttention:1> extract file suffix name: ${file##*.}# #是贪婪操作符, match from left to right, match to the
The Shuf command can randomly extract different lines of a text file, output to a file or standard output.Shuf usage: Shuf [options] ... [File] or: Shuf-e [Options] ... [Parameters] ... Or: Shuf-I. lo-HI [Options] ... Write a random permutation of
1) Count the number of rows in the index.php file in the current directory[[email protected]_web1 ~]# cat index.php |wc -l172) Statistics web directory, JS file number:[[email protected]_web1 ~]# find web/ -name "*.js" |wc -l3) Statistics web
1 Create a good conversion under Windows and place it under one of the Linux folders. such as: Put the 0816_em.ktr file under the/home/cfj/kettle/testdemo.Note that the database user name and password may need to be changed if it is a job file such
guess the number game. First let the system randomly generate a number, give the number a range (1-60), let the user enter the guessing number, the input is judged, if not meet the requirements, give high or low hint, guess the right after the
In the project you need to train in a batch of new datasets with the same format, without having to copy the new data set to the original training data directory, and simply create a link to the new data file in the original training data
If you want to compare two version number strings through the shell, such as two version numbers 1.1.2 and 1.2.1 Two versions who are relatively new.The simplest is to use the sort command. With the parameter "-V" the sort command can sort the
System variables, display all variables of the current shell set reference variable $ plus variable nameGlobal variable: Export variable nameAssign the return value of the command to the variable: a= ' ls-la ' inverted quote equals a=$
The contents of the log file are as follows:logid=2210608107 worker_id=140610281404160 optime=1452598610.631276 msg=service+not+found+in+share+memory service=Redis_doc_pushThe post-column output is obtained through awk, and the disadvantage is that
1. RequirementsServer Master Agent Envtype8.0.0.1 8.0.0.11 8.0.0.111 AAA8.0.0.1128.0.0.12 8.0.0.1138.0.0.1141. Get the list of machines in the document/etc/ansible/hosts[Server][Master][Agent]2. contract to target Machine2.1 Send flask to all
In shell programming, operators are essential, and can be said to be used in every script. Familiarity with mastering operators is a basic skill.
Comparison operators:
eq
Equals
Ne
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.