360 Secure SkillHub
360 安全技能中心

Grep Tool

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

分类:搜索
dinghaibin
dinghaibin
热度 24.62
最近更新 2026-05-11 17:46:25

安装

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