简单的文件去重复内容方法

2020年04月2日

这个方法是在hostloc社区上看到的,所以记录一下以备大伙需要的时候可以看到。

前言:有两个文件,要在B文件里删除A文件里有的内容。使用linux下的grep来实现的,这方法超简单快捷。

#文件A中不能有空行
grep -v '^ *$' A >A.tmp
grep -v -f A.tmp B >B.new

 


sicnature ---------------------------------------------------------------------
Your current IP address is: 54.145.82.104
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://myzhenai.com/post/3224.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注