Browse Source

添加了10215501422.txt

master
高宇菲10215501422 2 years ago
parent
commit
72cfbc9d3b
8 changed files with 93 additions and 0 deletions
  1. +23
    -0
      lab1/.ipynb_checkpoints/10211900416-checkpoint.sh
  2. +13
    -0
      lab1/.ipynb_checkpoints/10215501406-checkpoint.sh
  3. +13
    -0
      lab1/.ipynb_checkpoints/10215501406-checkpoint.txt
  4. +21
    -0
      lab1/.ipynb_checkpoints/10215501413-checkpoint.sh
  5. +0
    -0
      lab1/.ipynb_checkpoints/10215501422-checkpoint.txt
  6. +1
    -0
      lab1/.ipynb_checkpoints/52265903006-checkpoint.md
  7. +11
    -0
      lab1/.ipynb_checkpoints/hw1-checkpoint.sh
  8. +11
    -0
      lab1/10215501422.txt

+ 23
- 0
lab1/.ipynb_checkpoints/10211900416-checkpoint.sh View File

@ -0,0 +1,23 @@
#!/bin/bash
chmod +x ./work1.sh #add permisson to execute
rm strings
rm sort_by_ascii
rm sort_by_num
rm summ
rm strings2
for i in `seq 1000`; #50000 lines is too long to wait, choose 1000 lines
do
echo $RANDOM | md5sum | cut -c 1-9 ;
done >> strings
export LC_ALL=C
sort -d strings | uniq -u > sort_by_ascii
sort -n strings | uniq -u > sort_by_num
cat sort_by_ascii >> summ
cat sort_by_num >> summ
for i in `seq 666`; #generate a file randomly
do
echo $RANDOM | md5sum | cut -c 1-9;
done >> strings2
grep -o "de" strings2 | wc -w

+ 13
- 0
lab1/.ipynb_checkpoints/10215501406-checkpoint.sh View File

@ -0,0 +1,13 @@
#1
for i in `seq 50000`;do echo $RANDOM | md5sum | cut -c 1-9 ;done > 1.txt
sort -d 1.txt | uniq
sort -n 1.txt | uniq
sort -d 1.txt | uniq > 1_uniq_by_asc.txt
sort -n 1.txt | uniq > 1_uniq_by_num.txt
cat 1_uniq_by_asc.txt | uniq >> 1_uniq_total.txt
cat 1_uniq_by_num.txt | uniq >> 1_uniq_total.txt
#2
for i in `seq 50000`;do echo $RANDOM | md5sum | cut -c 1-9 ;done > 2.txt
grep 'computer' 2.txt
grep -o 'computer' 2.txt | wc -l

+ 13
- 0
lab1/.ipynb_checkpoints/10215501406-checkpoint.txt View File

@ -0,0 +1,13 @@
#1
for i in `seq 50000`;do echo $RANDOM | md5sum | cut -c 1-9 ;done > 1.txt
sort -d 1.txt | uniq
sort -n 1.txt | uniq
sort -d 1.txt | uniq > 1_uniq_by_asc.txt
sort -n 1.txt | uniq > 1_uniq_by_num.txt
cat 1_uniq_by_asc.txt | uniq >> 1_uniq_total.txt
cat 1_uniq_by_num.txt | uniq >> 1_uniq_total.txt
#2
for i in `seq 50000`;do echo $RANDOM | md5sum | cut -c 1-9 ;done > 2.txt
grep 'computer' 2.txt
grep -o 'computer' 2.txt | wc -l

+ 21
- 0
lab1/.ipynb_checkpoints/10215501413-checkpoint.sh View File

@ -0,0 +1,21 @@
#!/bin/bash
# 读取随机数据并转为 base64 编码
head -n 50000 /dev/urandom | base64 > random;
# 抽取 50000 行数据
head -n 50000 random > random2;
# rename
rm random;
mv random2 random;
# 按 asc 排序
sort --unique random > unique_sort_by_asc;
# 按 num 排序
sort --unique --numeric-sort random > unique_sort_by_num;
# 追加写
cat unique_sort_by_asc > totall;
cat unique_sort_by_num >> totall;
# 匹配并统计字符
grep -o "com" totall | wc -l > number_of_com;

+ 0
- 0
lab1/.ipynb_checkpoints/10215501422-checkpoint.txt View File


+ 1
- 0
lab1/.ipynb_checkpoints/52265903006-checkpoint.md View File

@ -0,0 +1 @@
请大家把代码放到以自己学号命名的文件中即可。

+ 11
- 0
lab1/.ipynb_checkpoints/hw1-checkpoint.sh View File

@ -0,0 +1,11 @@
sort data.txt | uniq -u
sort -n data.txt | uniq -u
sort data.txt > data2
sort -n data.txt > data3
sort data.txt >> data2
sort -n data.txt >> data3
grep ABC data.txt
grep -o ABC data.txt
grep ABC data.txt | wc -l
grep -o ABC data.txt | wc

+ 11
- 0
lab1/10215501422.txt View File

@ -0,0 +1,11 @@
#1
sort -d file.txt | uniq
sort -n file.txt | uniq
sort -d file.txt | uniq > d.txt
sort -n file.txt | uniq > n.txt
sort -d file.txt | uniq >> d.txt
sort -n file.txt | uniq >> n.txt
#2
grep Maycomb test.txt
grep -o Maycomb test.txt | grep -c Maycomb

Loading…
Cancel
Save