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 Interactive scripting is a simple way to learn about APIs and a powerful tool for analyzing data set interactions.
The spark abstract distributed cluster space is called the Resilient Distributed DataSet (RDD) elastic data set.
There are two
Enter HBase Shell Console
$HBASE _home/bin/hbase Shell
If you have Kerberos authentication, you need to use the appropriate keytab for authentication (using the Kinit command), and then use the HBase shell after the authentication is successful. You
File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if
Definition and use of 1.shell variables my_dir= "/home/yk/desktop" # ( any character in single quotation marks is output as is, the variable in the single-quote string is not valid;)Echo $my _direcho ${#my_dir} #获取字符串长度2.shell annotations Single
January 11, 2017, Wednesday Shell parent-child processStart/execute mode:Current shell: #!/bin/bash must start at the beginning the first line of #! Will be discovered by the kernel, is a magic number , the kernel will
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
# Experimental Case One,**Writing sysmon.sh Scripts(1) Use the DF command to extract the disk occupancy of the root partition and assign a value to the variable dug.(2) Use the Mpstat command to extract the CPU usage (Install the SYSSTAT package)
Implementation scenario: 1. Add:& at the end of the command#/bin/Bashall_num=Tena=$(Date+%h%m%S) forNuminch`seq 1${all_num} ' Do { Sleep 1 Echo${num}}& Doneb=$(Date+%h%m%S)Echo-E"starttime:\t$a"Echo-E"endtime:\t$b"With the & symbol at the end
Today, we found that there are too many empty lines in a file and we intend to delete them.
So I used SED and checked the command to write it like this:
Sed '/^ $/d' file1
I found that there are still a lot of blank lines in the output content,
1. Find the number of times "Linux" appears in the file sample.txt
#! /Bin/bash # How many "Linux" in linux.txt? Grep-o "Linux" linux.txt | WC-lgrep-c "Linux" linux.txt
2. Retrieve the first column (User Name) of/etc/passwd and use "the N
From: http://standalone.javaeye.com/blog/511101
1. Use the shell variable $ randomEcho $ random
2. Use Random Functions of awkAwk 'in in {srand (); print rand ()}'
3. Use the System Device File/dev/random and/dev/urandomDd If =/dev/random | OD-
This book has no answer. If you send an email to the author, he will not provide the answer. So I had to answer the question myself.
Chapter 5
5.1
Q Cai-English-1984-Jiangsu-7
Q Cai-English-1984-Jiangsu-7
Q Cai-English-1984-Jiangsu-7
Q Cai-English-19
You often need to switch to a common directory, but the path is long and hard to remember. You want to use a script to enter the directory, but it will never change .......
Cause analysis:
When the script is executed, only a sub-process is
Several Popular Shells
Currently, popular shell types include ash, Bash, KSh, CSH, and zsh. You can use the following command to view your own shell types:# Echo $ Shell$ Shell is an environment variable that records the shell type used by the user.
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:$
Shell special characters
Wildcard
Wildcard characters are used for pattern matching, such as file name matching, path name searching, and string searching. Common wildcard characters include (*),(?) And the Character Sequence enclosed in square
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