Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
anew — 一个向文件添加新行并跳过重复内容的工具 | Kitploit
工具/GitHubGitHub/tomnomnom/anew
通用工具脚本与自动化实用工具与框架
GitHubtomnomnom/anew

anew

一个向文件添加新行并跳过重复内容的工具

查看仓库
1.7k1722年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

anew

将来自stdin的行追加到文件中,但仅当这些行尚未出现在文件中时。 新行也会输出到stdout,因此它有点像tee -a,但会去除重复项。

使用示例

这里,一个名为things.txt的文件包含一个数字列表。newthings.txt包含第二个 数字列表,其中一些出现在things.txt中,另一些则没有。anew被用来 将后者追加到things.txt中。

root@kitploit:~
▶ cat things.txt
Zero
One
Two

▶ cat newthings.txt
One
Two
Three
Four

▶ cat newthings.txt | anew things.txt
Three
Four

▶ cat things.txt
Zero
One
Two
Three
Four

请注意,添加到things.txt的新行也会发送到stdout,这允许它们被 重定向到另一个文件:

root@kitploit:~
▶ cat newthings.txt | anew things.txt > added-lines.txt
▶ cat added-lines.txt
Three
Four

参数

  • 如果只想在stdout中查看输出,而不追加到文件,请使用试运行选项-d。
  • 如果只想追加到文件,而不向stdout打印任何内容,请使用静默模式-q。

安装

你可以使用go进行安装:

root@kitploit:~
go install -v github.com/tomnomnom/anew@latest

或者为你的平台下载一个二进制发布版。

下载工具