Shell Introduction and basic usage

8.1:shell Introduction:The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, supports logical judgments, loops, and each user can have his or her own shell:The CentOS default shell

Shell programming Develop good habits

1. Export path= $PATH:/usr/local/mysqlPut the $path in front, or to add to the path inside of the way to write the wrong words, you are tragic, processing is still more troublesome2. crontab inside Execute script remember Source/etc/profileCrontab

Shell Script Basics

Shell ScriptStandardize the general composition of shell scripts#! Environmental Statement (Sha-bang)# comment TextExecutable codeConsiderations for setting variablesIf the specified variable name already exists, it is equivalent to re-assigning a

Shell programming--looping statements

2. Case statementOnly one conditional relationship is judgedGrammar:Case¢ variable name in"Value 1")Procedure 1;;"Value 2")Procedure 2;;*)Procedure 3;;Esac3. For loop1) Syntax: (Assigning a value to a variable executor, several values are executed

Shell Programming-Regular expressions

Basic Regular expression:A regular expression differs from a wildcard character:A regular expression is used to match a string in a file that matches a condition, and a regular contains a match. grep, awk, sed, and other commands can support regular

Linux--Shell programming

Linux--Shell programming one, regular expression 1, regular expression PK wildcard        2.Basic Regular Expressions1),*The previous character matches 0 or more times~ grep "A *" Test_rule.txt # matches all content, including blank lines~ grep "aa*"

"Shell"--basic knowledge (1)

First, the basic knowledgeHere you'll learn about shell fundamentals and some of the knowledge points.Concept: The shell is the user interface of the system and provides an interface for users to interoperate with the kernel. It receives the command

Shell-neutral expression primitive characters

^ matches only the beginning of the line$ matches end of line only* A single character immediately after the *, matching 0 or more of this single characters, it can also be a sequence. You can use-to represent a range of character sequences within []

Using the shell in Linux to analyze the information in the statistics log

In operation and maintenance work, we should analyze the log of back-Office system frequently, and provide the basic data for the monitoring result by grasping the key word information in the log and counting the fetch results.The following shell

Shell comparison two text different

Comm CommandUsage scenarios:Requires a common list of records for two files or a list of records that appear only in the first file but do not appear in the second fileHow to use:Must be sorted first, that is, sortParameters1 shows columns in the

Shell---Data flow redirection

Data Flow redirection: is a command that should appear on the screen after the data transfer to other places.Standard input (stdin): code 0, using Standard output (STDOUT): Code 1, using > or >>;Standard error Output (STDERR): Code 2, using 2> or 2>>

Shell Script First Learning

The first shell program runs, tutorial from: http://jingyan.baidu.com/article/8cdccae947f83e315413cd05.htmlThe code is as follows:1 #!/bin/sh2touch a.txt3sleep4 echo"testtesttesttest">>a.txtI don't know why. Tip: MSYS2 terminal has stopped working.

Shell finds files within a specified time period

#!/bin/bash#20170905 input parameter formatecho "displays" Backup Files "Date_0=$1date_1= ' expr $date _0 + 1 'date_2= ' expr $date _0 + 2 '#定义时间段touch-d $date _0/tmp/tm-0.file #开始时间touch-d $date _1/tmp/tm-1.file #结束时间1touch-d $date _2/tmp/tm-2.file

Shell Judgment String Equality script

#!/bin/shEcho-n "Login:"Read nameEcho-n "Password:"Read passwdIf ["$name" = "AA"-a "$passwd" = "AAA"];thenecho "right!"else echo "Error"FiOne. the problem with [: missing '] in the running process is ["$name" = "AA"-a "$passwd" = "AAA"] "$name"

Shell file permissions and script execution

ll command to view file informationThe first root represents the creator of the file, and the 2nd root represents the group root that the file belongs toRWX delegate Rights R (read) permission, W (write) write permission, x Execute permission,

Shell Common Commands

1. View Memory usageFree-m2. View drive Information usageFdisk-l3. View CPU and Memory usageTop4. View CPU Information commandsCat/proc/cpuinfo5. View memory InformationCat/proc/meminfo6. Modify the IP

How the shell script modifies lines in the text before matching rows

Original documents, welcome to read, Forbidden reprint.In the example, the "yes" in the previous line of the finish is changed to "yes"One way to do this is to use Sed+awk together.[Email protected]:~$CatA.txtline0is yesline1is yesline2is yesline3is

"Gadget" shell detects process status exception auto restart

The shell script is an operation of the basic skills of personnel, in peacetime work, in order to deal with some anomalies or query data, I often have to write shell scripts automated processing.Here to share a script I wrote to detect the status of

Bulk Delete User--shell script

#!/bin/bash# #User  : mobanche#date : 2017-7-17#work : delete user########### ####################################          define  function         ############################################### function get_answer {#unset  ANSWERASK_COUNT=0#while 

Windows automatically uploads and executes Linux-specified shell files

Install Putty.exe, the following EXE files are installed in the installation directoryCreate File Put-file-mobile.txtRM Mobile.warput D:\SVN_LZY\dragon-tour-2_1\lzy-mobile\target\mobile.warexitCreate a batch file release-mobile.batPsftp.exe [email

Total Pages: 541 1 .... 519 520 521 522 523 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.