|
|
@ -0,0 +1,20 @@ |
|
|
|
touch random |
|
|
|
for i in {1..50000} |
|
|
|
> do echo $RANDOM | md5sum | cut -c 1-9 |
|
|
|
> done >> random // 生成随机字符串 |
|
|
|
|
|
|
|
sort random -o string.txt // 将排完序的内容写入string.txt中 |
|
|
|
sort random | uniq // 将内容去重输出 |
|
|
|
|
|
|
|
sort -n random -o number.txt // 将排完序的内容写入number.txt中 |
|
|
|
sort -n random | uniq // 将内容去重输出 |
|
|
|
|
|
|
|
touch file.txt |
|
|
|
cat string.txt > file.txt // 覆盖 |
|
|
|
cat string.txt >> file.txt // 追加 |
|
|
|
|
|
|
|
|
|
|
|
touch count.txt // 创建文件 |
|
|
|
vim count.txt // 打开这个文件,并向里写入文字 |
|
|
|
grep -o "farmer" count.txt // 输出匹配的项 |
|
|
|
grep -o "farmer" count.txt | wc -l // 统计个数 |