Output Effect Format control:\033[0m Turn off all properties\033[1m Set High brightness\03[4m Underline\033[5m Flashing\033[7M Reverse Display\033[8m Hidden\033[30m--\033[37m set foreground color\033[40m--\033[47m Set background color
Format
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
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
Shell IntroductionThe shell is a program written in C and a bridge for users to use Linux. The shell is both a command language and a programming language.Shell script, a scripting program written for the shell.Shell Environment
The Bourne
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
WC
StatisticsThe number of words, lines, and characters in the file.
WC syntax
[Root @ WWW ~] #WC[-LWM] Options and parameters:-L: only list rows;-W: Only the number of words listed (one English word );-M: The number of characters;
WC
Fork
Usage: fork/directory/script. Sh
Fork is the most common. It uses/directory/script. Sh directly in the script to call the script. Sh script.
Run a sub-shell script to execute the call. When Sub-shell is executed, parent-shell is still
Trap allows you to capture signals in the script. The common form of this command is:
Trap name signal (s)
Among them, name is a sequence of operations taken after the captured signal. In real life, name is generally a function specifically used
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-
-B. returns true if the file exists and is a block file.
-C: returns true if the file exists and is a character file.
-D. If pathname exists and is a directory, true is returned.
-E: returns true if the file or directory specified by
Shelll basic programming theory and some examples
Abstract: This article describes how to compile a shell script based on a large number of instances. (13:27:24)
Why shell programming?
In Linux, although there are various graphical interface
Problem: It is necessary to pre-process a file of several GB and tens of millions of lines.
Function: splits records in a file into different files according to certain rules.
Advantage: It is really convenient to use shell scripts for text
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.
Standard Input and Output
When executing a shell command line, three standard documents (stdin) are automatically opened, which usually correspond to the keyboard of the terminal. stdout) and stderr correspond to the terminal screen. The process
Publicc void setalpha (INT alpha)Alpha range: 0 ~ 255
This method is supported from eclipse3.4.
/*** Sets the operator's Alpha value which must be* Between 0 (transparent) and 255 (opaque ).* * This operation requires the operating system's advanced*
Mainly shell several common operations: 1 shell and awk combined with 2 shell string operations 3 shell file operations and awk combined 4 file MD5 verification 5 results output 6 passing parameters, etc.
The following content cannot be
1. system environment variables after the user logs on to the system:$ Home user's own directory$ Path: the directory to be searched during Command Execution$ TZ Time Zone$ Mailcheck the number of seconds to check whether a new letter exists$ PS1
Notes for shell script programs: variables can be directly used without prior declaration; the variable does not have any data type. The default value is a string; no space is allowed on any side of the equal sign of the value assignment operation.
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