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
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.
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 '
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
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
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
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:
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
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
#!/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
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
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 [
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
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 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
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
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
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]"
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,
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