360 Secure SkillHub
360 安全技能中心

Uniq Tool

该 Skill 提供 uniq-tool 命令,用于处理已排序文本中的重复行,可去重、统计每行出现次数、只输出重复行或唯一行,并支持大小写不敏感比较。可读取输入文件并写出输出文件,底层包含 Python 脚本并依赖 uniq 二进制及 bash、python3 运行时。

dinghaibin
dinghaibin
热度 30.01
最近更新 2026-05-11 17:47:44
分类:效率依赖:代码执行 / 读写文件应用场景:数据处理 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add uniq-tool
Metadata
name
uniq-tool
description
Report or filter repeated lines in sorted text. Use for deduplication, frequency counting, and data cleanup.

Duplicate Line Filter

Remove or count consecutive duplicate lines from sorted input. Works best with pre-sorted data using sort-tool.

Usage

uniq-tool [options] [input_file [output_file]]

Options

  • -c: Count occurrences of each line
  • -d: Only show duplicate lines
  • -u: Only show unique (non-duplicate) lines
  • -i: Case-insensitive comparison

Examples

# Remove adjacent duplicates
uniq-tool sorted.txt

# Count occurrences
uniq-tool -c sorted.txt

# Only show duplicates
uniq-tool -d sorted.txt