Shell script to generate test data
Vim data_create.sh
Rm-rf./data.txt
Touch Data.txt
For ((i=0;i<2000;i++))
Do
Str= ', name ';
Name=${i}${str}${i}
#echo $name
echo $name >> data.txt
Done
echo ' Show TestData '
More Data.txt
chmod u+x data_create.sh
Run the script
Sh-x data_create.sh
Crontab timed Task Execution shell
Crontab-e Modifying the current user
Crontab-l View
Crontab-l-u root/mysql viewing a user's scheduled tasks
Format: Time-sharing week to run the command
First column minute 1-59
Second column hour 0-23 "0 is 24 points"
Third Liege 1-31
The fourth column is month 1-12.
Day of the week 0-6 "0 is Sunday"
* Indicates that the attribute is ignored
* * * * * cd/root/makaidong_com/file && sh-x fordata.sh >> fordata.log 2>&1
&
Shell while loop: within 10 and =55
#!/bin/bash
Sum=0
I=1
while ((I <= 10))
Do
Let "sum+=i"//sum = Sum+i
Let "i + = 1"//i=i+1
Done
echo "Sum= $sum"
Tar
Linux Compression/Decompression
Gzip-r
Gzip-c *.11.txt > filename.gz
How Linux unlocks the retention source file:
Gunzip filename.gz > FileName
Introduction to Linux and common commands getting started with 5--linux shell programming