gpt4 book ai didi

linux - 我应该如何计算每个文件中的重复行?

转载 作者:太空宇宙 更新时间:2023-11-04 10:21:16 24 4
gpt4 key购买 nike

我已经试过了:

dirs=$1
for dir in $dirs
do
ls -R $dir
done

最佳答案

像这样?

$ cat > foo
this
nope
$ cat > bar
neither
this

$ sort *|uniq -c
1 neither
1 nope
2 this

并剔除只有 1 的那些:

... | awk '$1>1'
2 this

关于linux - 我应该如何计算每个文件中的重复行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43783960/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com