Lao Li share: "Linux shell Script Raiders" Essentials (iii)

1, the production of any size file [[email protected] dd_test]#[[email protected] dd_test]# dd If=/dev/zero of=junk.data bs=1k count=1010+0 Records in10+0 Records out10240 bytes (Ten kB) copied, 0.00137023 S, 7.5 mb/s 2, File system related test [-f

Shell script copies folder contents to another folder, and automatically backs up if it exists

Sometimes we need to overwrite a folder to our working directory, but need to automatically back up the existing files, one to go back to the backup is too troublesome, all the backup is not necessary. Shell scripts can do a good job of doing this.

The shell connects two scripts.

Tag: The shell connects two scripts.#!/bin/bash##This is for auto run the script to save the time##By [email protected]#chose the latest file and chose one to runarray[0]= ' Ls-lt/mnt/shfw/builds/griffin/experimental | awk ' {print $9} ' | Sed-n '

One of the basics of shell programming

OutlineFirst, the programming language classificationSecond, Shell classificationIii. Variables Related conceptsIv. Types of Bash variablesFive, logical operationSix, arithmetic operationsSeven, bash condition test type and test methodViii. the

Shell menu (Springboard Management and connection scripts)

#!/bin/bashWap_server= "10.0.0.1"Mem_server= "10.0.0.2"Erp01_server= "10.0.0.3"Erp02_server= "10.0.0.4"Erpold_server= "10.0.0.5"Backup_server= "10.0.0.6"Monitor_server= "10.0.0.7"Dossh=/home/lichuang/scrips/dossh.sh

Several parameters of the shell script

The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number of parameters for this program$$ the PID of this program (the current

Shell handles files that contain spaces in the file name

Recently learning Gradle, using the git clone command to download some information, but the file name contains a space, it does not seem very comfortable, so think of using shell script to batch it, remove the file name of the space, note that this

Shell Primer-grep Filter-1

The regular expression is a string. There is a certain pattern. We use the specified string to match a specified line. The specified string is the regular expression.Regular expressions have these tools: grep egrep sed awkCommand: GerepDescription:

Getting started with the shell-system and user profiles

Variables are divided into system variables and user-defined variables, and their profiles are of course divided into system environment variable configuration file and user environment variable control file.1. Specify the configuration file for the

Save the shell command as a variable

The command is placed in the "(General keyboard 1 to the left of the key), such asEcho ' DMESG | grep ETH ' The command is placed in $ (), such asecho $ (DMESG | grep eth) Can be saved to the variable varname as followsVarname= ' DMESG | grep

Shell Redirection File Descriptor

#!/bin/bashRecently looking at the shell, a variety of puzzles, but to solve the feeling of confusion is still very good. Needless to say, Linux uses file descriptors to identify each file object. The file descriptor is a non-negative integer that

Traverse the file and format the output file (Shell script implementation)

Background1. In project development, it is urgent to generate files in the following three formats according to the files under the resource path Res.Format one:#define IDR_CEF_0001 101#define IDR_CEF_0002 102...#define IDR_CEF_0122

Shell Multi-file Content Association match

Remove the first two columns from the a file and match the other file to print out the matching line from=$1compare=$2tofile=$3f1s= ($ (cat $from |awk-f ' \ t ' "{print $")) f2s= ($ (Cat $from |aw   K-f ' \ t ' {print $} ') #for i in ' seq 0 ${#f1s [

Shell learning: Calling between scripts

For Java,python, you can use the import method to make calls between scripts or modules, for example:>>> Import math>>> math.sqrt (4) 2.0how to invoke other shell scripts in the shell. Or a variable in another script, what about the function?method

Linux, Shell scripting Brute force user name and password

Because some registered user account rules can follow, and usually people's awareness of the poor, the password is relatively simple, the user name of the common password login test, to break the password.For learning purposes only, do not use for

Shell Bash determines whether a file or folder exists

Shell Bash determines whether a file or folder exists1, #如果文件夹不存在, create Folders folder="Log"if[!-D"${folder}" ]; Then mkdir ${folder}fi2To determine if a file exists.="/var/www/log.txt"# -The f parameter determines whether the $file

Shell control Flow Structure notes

Man test can see these  Comparison symbol:-lt less than-le less than or equal to-gt greater than-ge greater than or equal to-ne does not equal-eq equals Greater than (requires double brackets), such as: (("$a" > "$b") >= greater than or equal

[Shell advanced] The most bull B Linux shell Command (ii)

1. Use your favorite editor to tap the command command After the command has been knocked out, press , will open an editor you specify (such as Vim, through the environment variable $editor specified), which is the

September 13 Tenth session Linux shell script programming Basics

Tag: blank linux target password nullHomework 1, request to add a user newuser, if it already exists then display "The user USERNAME is exists", if present, add it and set its password to "[email protected]"

The Linux Shell Array uses

Ubuntu12.04 TLS 64bit, bash 4.2.25First, the definitionAn array is a collection of some data, divided into two types(1) ordinary arrays, only integers can be used as indexes(2) Associative array , can use string as index, Bash 4.0 start support,

Total Pages: 541 1 .... 367 368 369 370 371 .... 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.