是否有unix命令可以检查文件中的任何两行是否相同?
例如考虑一个文件 sentences.txt
This is sentence X
This is sentence Y
This is sentence Z
This is sentence X
This is sentence A
This is sentence B
我们看到这句话
This is sentence X
重复。
是否有任何命令可以快速检测到这一点,以便我也许可以像这样执行它-
$ cat sentences.txt | thecommand
Line 1:This is sentence X
Line 4:This is sentence X