杨贵福老师的方法

  1. cat tr sed sort head 命令的综合使用方式1
$ cat pg11.txt |tr -cs A-Za-z\' '\n' |sed "/'/d"| tr A-Z a-z | sort|uniq -c |sort -k1,1nr -k2 | head


结果为:

    1797 the
    884 and
    804 to
    679 a
    619 of
    537 she
    515 it
    462 said
    423 in
    395 you

\2. cat tr sed sort head 命令的综合使用方式2 (PS:刚刚加了sed这一条,用于删除 ' 这个被匹配的单词)

$ cat pg11.txt |tr -cs A-Za-z\' '\n' | tr A-Z a-z | sort|uniq -c |sort -k1,1nr -k2 | head


结果为:


   1797 the
    884 and
    804 to
    679 a
    619 of
    537 she
    515 it
    462 said
    423 in
    395 you

相关文章:

  • 2022-12-23
  • 2021-12-19
  • 2022-01-29
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-11-08
猜你喜欢
  • 2021-12-17
  • 2021-08-07
  • 2022-01-20
  • 2022-12-23
  • 2021-09-10
  • 2023-03-12
  • 2022-02-06
相关资源
相似解决方案