(031) The shell location parameters of Linux

Fundamentals of the ten-year OPS series-LinuxZeng LinContact: [Email protected]Website: www.jplatformx.comCopyright: Please do not reprint the article without permission First, IntroductionWe have not had the ability to receive and process

Shell base SED usage

SED: Line processing command, default does not modify the original file, only the data in the pattern space to do processing, after processing, the mode space to print to the screensed [options] ' addresscommand ' file ...-N: Silent mode, content

Linux CentOS under the shell display-bash-4.1$ does not display the user name and host name of the workaround

New CentOS Add a user, log in to find that the shell script information does not display the user name and host name, but instead shows the-bash-4.1$, instead of the [email protected]$ combination that we often see, looks particularly uncomfortable. 

Common Linux shell commands

1. File operationCP MV MkDir CatTouch creates a new file, changes the last modified dateSource makes the file effective immediatelyWc-l the number of rows in the filename statistic file2. System commandsWHO displays user information currently logged

The IF format of the shell

The format of the IF in the shell:If [conditions]ThenExprelif [conditions]ThenExprElseFi[Conditions] includes1.!,-A,-o2.-n,-z, =,!=3.-eq,-ge,-gt,-le,-lt,-ne4.-ef,-nt,-ot5.-b,-c,-d,-e,-f,-g,-g,-h,-k,-l,-o,-p,-r,-s,-s,-t,-u,-w,-xType 1 is a logical

I. Shell BASIC Concepts

I. What is a shell?      4.shell provides a way for you to communicate with the operating system. There are two kinds: a.Interactive mode:(Input from the keyboard and can be immediately responded to) in fact, one command is entered at a time;B.

CreateLiveCMSV4.0 vulnerability, no background get shell required

title:createlivecmsv4.0 vulnerability, no background get shell--2012-03-06 17:28Title: createlive CMS Version 4.0.1006 Vulnerability without background Get shellRequired environment: IIS6, upload directory executable scriptCreatelive CMS Version 4.0.

SSH anti-brute shell script

Write an SSH anti-violence hack script.The principle is to detect the SSH connection log, filter the login failed IP, more than the number of login to add it into the Hosts.deny file, limit its login.The script is as follows:#! /bin/bashcat /var/log/

The judgment statement in the Linux shell

Remember that if and the [] are whitespace1. String judgmentSTR1 = str2 When two strings have the same content, length is trueStr1! = str2 True when string str1 and str2 are not equal-N str1 True when the length of the string is greater than 0

Shell Pattern Matching

Special characters in shell pattern matching * Matches any string (including an empty string). ? matches any single character . [...] Matches any character that is contained.

Reference usage description for shell scripts

#!/bin/bash#演示全引用和部分引用#双引号和没引号的区别variable1=2010echo "$variable 1"echo $variable 1variable2= "x y z" # #字符之间用多个空格隔开echo "$variable 2" # #双引号echo $variable 2 # #没引号#单引号和双引号的区别echo "$PWD is the current directory." # #双引号Echo ' $PWD is the current

Test usage of shell scripts

#!/bin/bash#1. Integer comparison operators#整数变量和整数常量比较Num1=15["$num 1"-eq] #测试num1是否等于15echo $? # #退出状态为0, means NUM1 equals 15["$num 1"-eq] #测试num1是否等于20echo $? # #退出状态为1, means num1 is not equal to 20["$num 1"-lt] # #测试num1是否小于15echo $? # #退出状态为1,

A few good shell scripts

A few examples of shell scripts, feel good." Example: 001 " judging the input as a number, character or other #!/bin/bashread-p ' Enter a number or string here: ' Inputcase $input in [0-9] ' echo-e ' good job, Your input is a numb eric! \ n ";

Getting Started with Shell learning

Impression, always think that as long as mastering the Linux command, natural for writing shell scripts will not be unfamiliar. This is not right. The first half of the sentence is true, it is necessary to master the Linux command, so as to write

Linux-shell Test

The nature of the test:is an action commandDetermine if the condition is true based on the $? return valueOperating Specifications:Format 1:test conditional expressionFormat 2: [Conditional expression]Contact method for the test operation:Direct

Scripting Shortcuts: A tool for simplifying shell Terminal command input

1. Issues to solveWhen you need to enter a number of commands at once , such as deleting files in multiple directories at onceCD Dir1RM file1.tempCd.. /.. /dir2RM-RF Dir3When you are too lazy to enter a good long command or simply can't remember

Summary of methods for intercepting strings in the shell

There are a number of ways to intercept strings in the shell, and there are 9 ways to use ${expression. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}

Automatic FTP scripting (shell Bat) under Linux and Windows

First, look at Linux under:Copy CodeThe code is as follows:#! /bin/bashcd/ftp/Currentdate= ' Date +%y%m%d 'Yesterday= ' date-d yesterday +%y%m%d 'Threedayago= ' date-d ' 3 days ago ' +%y%m%d '#echo $TWODAYAGOFtp-n-I 34.97.34.3 User Ftpuser

Return values of functions in Shell

Return values of functions in Shell#! /Bin/shSum (){Echo $($1 + $2 ))Return $($1-$2 ))}Sum $1 $2C =$ (sum $1 $2)Echo $?Echo $ cRun the command:./bashTest 11 1.The running result is:12 -- result of sum $1 $210 -- echo $? Because the return value is 10

Shell script programming 2

Shell script programming 2 Custom environment variables (global variables) Set Environment Variables If you want to set environment variables, you must use the export command after assigning values to the variables or setting the variables, declare

Total Pages: 541 1 .... 384 385 386 387 388 .... 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.