From f4feb986c6a81acc09d33e8c60913c2bbdeb1384 Mon Sep 17 00:00:00 2001 From: TakanashiXny <2110520134@qq.com> Date: Sun, 11 Sep 2022 15:54:54 +0800 Subject: [PATCH] 10215501438 --- lab1/10215501438.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lab1/10215501438.txt diff --git a/lab1/10215501438.txt b/lab1/10215501438.txt new file mode 100644 index 0000000..5e7b4a4 --- /dev/null +++ b/lab1/10215501438.txt @@ -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 // 统计个数