Browse Source

Merge pull request #6 from TakanashiXny/main

10215501438
main
Eugene Zhu 2 years ago
committed by GitHub
parent
commit
b3ef890fc3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      lab1/10215501438.txt

+ 20
- 0
lab1/10215501438.txt View File

@ -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 // 统计个数

Loading…
Cancel
Save