Batch modify file suffix
The first type:
#!/bin/bashfor fn in *.$1domv $fn ${fn%$1}$2done
The second type:
Find. -name "*.txt" | Awk-f ' [./]+ ' {print $} ' | Xargs-i-T mv {}.txt {}.sh
GREP User Tips
The file is as follows:
# cat Test.txt This was a test Filea good day and no coludysit here and sing a Songmiss Agao istingbut money are money!this Is:hangonly one line.
-W matches entire word, avoids word character match
# grep-w is Test.txt-a test filebut money are money!this Is:hang
No match to Isting
-A matches N rows after
# grep-a 3 sit test.txt sit here and sing A Songmiss Agao istingbut money are money!this Is:hang
-B matches the previous n rows
# grep-b 2 Sit test.txt This was a test Filea good day and no coludysit here and sing a song
-C matches before and after n rows
# grep-c 2-i sit test.txt This was a test Filea good day and no coludysit here and sing a songmiss Agao istingbut money I S money!
-C Statistics Match line number:
# grep-c is test.txt 4
-O displays only matching strings:
# Grep-o Money Test.txt Moneymoney
-o-b shows the location of the match:
# Grep-o-B Sit test.txt 45:sit
Intersection and Difference sets:
# cat 1.txt 1234# cat 2.txt 123456
Intersection:
# grep-f 1.txt 2.txt 1234
Subtraction
# GREP-VF 1.txt 2.txt 56
This article is from the "OPS rookie" blog, please be sure to keep this source http://ckl893.blog.51cto.com/8827818/1766655
Shell tips modification Suffix and grep