Note Using expr:The operator and the number used for the calculation have at least one space around it, otherwise the errorWhen using multiplication sign, a backslash must be used to mask its specific meaning.An enterprise-class case study of
One step in writing a shell is to take a piece of text and process it.I. SED commandSed is a powerful streaming editor (stream editor for filtering and transforming text) that works perfectly with regular expressions, processing text line by row and
The first is to find the file name by using a-name parameter.Query for files ending in. txt, and files that begin with T :[Email protected]:~/test$ lsone.txt three.txt two.txt[email protected]:~/test$ Find/-name ' *.txt './two.txt ./one.txt./three.
First, regular expressionBefore learning the Find command, we have been exposed to some simple regular, so we can now learn some complex regularization. First of all, we still have to review what is regular expression, see this tutorial first, must
Some bits and pieces of basics I. Understanding shell scriptsa) Related conceptsThe shell is a command interpreter that executes the commands and programs that the user enters in order (the command that encounters the sub-script, which executes the
Shell Script Fourth-common small script 1, the system process according to the size of memory consumption display out# PS-E-o "%c:%p:%z:%a"|sort-k5-nr2. The system process is displayed by CPU size# PS-E-o "%c:%p:%z:%a"|sort-nr or # PS aux--sort-rss3,
1.shell command interpreter or shell auto-ops language2. How to execute a shell script(1) Execute permission must be given./first.sh(2) SH first.sh(3) Source first3. More complete Script compositionScript DeclarationComment InformationExecutable
Shell is an important application in the operating system, especially for Linux, the command-line mode of the operating system, the shell is of great significance.First, what is the shellThe shell is a command interpreter that provides interaction
1 scripting[Email protected] ~]# vim/root/yum.shScript content:#!/bin/bashrm-rf/etc/yum.repos.d/*echo "[110]name=110Baseurl=http://192.168.4.254/rhel7//yum Source to see the actual change, it is best to use the network Yum source, to ensure that
First, the pipe characterPipe character: pipe symbol used to pass the result of the previous command to another commandExample:1. Count the number of rows in a fileCommand: CAT/ETC/PASSWD | Wc-l2. Count the number of files in the current
Shell IntroductionShell is a Linux interactive media with users the CentOS default shell is bashCommand History 2User home directory file record command historyLs/root/.bash_historyHistory view commands Historical maximum can view 1000
Shell TutorialsShell is a C language program, he is a user using Linux bridge, Shell is both a command language, but also a programming language.The Shell refers to an application that provides an interface through which users access the operating
first, how to debug 1. Parameters through the SH command:SH [-NVX] Scripts. SH options and Parameters:-N: Do not execute script, query syntax only;-V: Before executing sccript, output the contents of scripts to the screen;-x: script to be used The
1. Create a folder script:#!/bin/bash#mkdirmkdir/home/img/pages/savedpictures/mission/xinlangweibo/$12. Query whether the folder exists:#!/bin/bash#find dirfolder= "/home/img/pages/savedpictures/mission/xinlangweibo/$1/" if [!-D "$folder"]; Then #no
#!/bin/SHCurr_dir=$ (CD $ (dirname$0);pwd) Td_base=`su-Tduser-c"Echo"${td_base}""`functionchange_app_ip () {if[$#-ne3]; Then Echo "The Param is not correct."Exit1 fi if[" $"!="app_ip"]; Then Echo "The IP type is not
Shell script:A text file that contains some commands or declarations and conforms to a certain formatFormat requirements: First line shebang mechanism#!/bin/bash#!/usr/bin/python#!/usr/bin/perlThe purpose of the shell script is:? Automation common
IntroductionWorking on the Linux platform, we often need to use the shell to write some useful and meaningful scripting programs. Sometimes, the shell array is used frequently. So, how does the array in the shell behave, and how is it defined? The
1: The cause of the problem, the deployment of hadoop-2.6.4 WINDOW10 operation Hadoop API error, the specific error is that I upload files to HDFs, but also better, previously resolved, not described here, here to say the error from the HDFs
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