1. Separate each command;Note: The execution of each command will not affect the execution of other commands. In other words, each command executes,However, there is no guarantee that each command will execute successfully.2. Separate && between
Create the user who wrote the file650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/98/E0/wKiom1lBR5_gYB4HAAAoKuZARYU671.png "title=" Screenshot from 2017-06-13 19-44-27.png "alt=" Wkiom1lbr5_gyb4haaaokuzaryu671.png "/>Second, ping 172.25.2
Shell Script Rollup 2 delete files that have been created for more than 32 days#!/bin/bash#date:2017-04-11#version:clear_ballcloud_back_v1.0#contents: removing the /www /web/ballcloud_bakck/* , if the file is created above 32 day#cd
#!/bin/bash#filename:ifs. SH Data="name,sex,rollon,location"oldifs=$IFSIFS= for inch $data; do Echo Item: $item Done #IFS= $oldIFSSet IFS to, number separator#!/bin/Bash#filename:fenge.SH Line="Root:x:0:0:root:/root:bin/bash"oldifs=$IFSIFS=":"
*: wildcard, matches any character, such as LS *.txt to see all files ending in. txt?: matches any one character#: annotation characters\: escape character for converting special symbols to normal characters, such as Touch \#.txt to create a file
The specific HBase shell commands are shown in table 1.1-1 below:Below we will use the example of "A Student score table" to detail the commonly used HBase commands and how they are used.Here grad for the table is a column, course for the table is a
1. Use-X to open the Shell script tracking debugging functionEx:bash-x script.shOrSh-x script.sh2. Partial debugging of scripts using Set-x and set +x (input middle content)#!/bin/bash#filename:debug. SH for inch {1.. 6 }; Do -x echo $i
Meaning: Split the file by column according to the delimiterSyntax format: cut [options] ... [File] ...-C, --characters by character-F,--fields by column-D,--delimiter specifies delimiter, default is tab (\ t)Example: viewing file contents Cat
grep: For fuzzy lookups, in standard input or file Format: grep [option parameter] ... PATTERN | FILE ...Option parameter Description:- E,--extended-regexp PATTERN is an extensible regular expression-E,--regexp=pattern using PATTERN for matching
Shell scripts can be directly./**.sh, or bash **.shI use the./**.sh to run a script of my own, and the following error will appear:[Email protected]:~$./pixel. SH bash:. /pixel. SH : Insufficient permissions [email protected]: sudo ./pixel. SH
This article mainly introduces the 4 methods of executing shell scripts in Linux, that is, 4 ways to run shell scripts in Linux, and the friends you need can refer to the followingThere are several ways to bash a shell script, and now make a summary.
Linux Command-line edit shortcut: History displays a list of command histories ↑ (Ctrl+p) Displays the previous command ↓ (Ctrl+N) Displays the next command!num executes the command history list of the num-bar command!! Execute the last command!?
The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d
Tag: Shell expression exists * * * Specify dir DIA statement return resultIf condition statement: The IF condition statement is divided into single branch structure, double branch structure, Multi-branch Structure-------------------------------------
Fourth articleUnderstanding shell command Execution Sequence analysisEach line that the Shell reads from a standard input or script is called a pipe (pipeline); it contains one or more commands, separated by one or more pipe characters (|).In fact,
Today to test a colleague wrote a shell script, execution of the error when the code is "Action:command not found"650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/EE/wKioL1k1HGHTyUhuAAAe51KKRyw564.png "style=" float : none; "title="
Regular Expressions A regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things. Life is full of regular: two
First, what is the regularA regular is a way to describe a character or string by combining symbols with special meanings, called regular expressions. Or, the regular is the rule used to describe a class of things.Second, grep1. Parameters-N: Show
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.