360 Secure SkillHub
360 安全技能中心

Grep Tool

该 Skill 提供 grep-tool 命令,用正则表达式在文本文件中搜索并输出匹配行,适用于日志分析、代码搜索和数据过滤。支持 -i、-r、-n、-v、-c 等常用选项;文件列表显示包含 scripts/grep.py,运行依赖 Python 3 和 grep。

dinghaibin
dinghaibin
热度 31.01
最近更新 2026-05-11 17:46:25
分类:搜索依赖:代码执行 / 读写文件应用场景:数据处理 / 调试排错 / 工作流

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add grep-tool
Metadata
name
grep-tool
description
Search text files for lines matching a pattern using regular expressions. Use for log analysis, code searching, and data filtering.

Pattern Search Utility

Search through files and output lines matching a given pattern. Supports basic, extended, and Perl-compatible regular expressions.

Usage

grep-tool [options] <pattern> [file...]

Common Options

  • -i: Case-insensitive search
  • -r: Recursive directory search
  • -n: Show line numbers
  • -v: Invert match (show non-matching lines)
  • -c: Count matches instead of showing lines

Examples

# Case-insensitive search
grep-tool -i "error" log.txt

# Recursive search
grep-tool -r "function" ./src

# Count matches
grep-tool -c "TODO" *.py