360 Secure SkillHub
360 安全技能中心

Uniq Tool

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

分类:效率
dinghaibin
dinghaibin
热度 21.72
最近更新 2026-05-11 17:47:44

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add dinghaibin/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