360 Secure SkillHub
360 安全技能中心

Sed Tool

该 Skill 以命令行方式提供流式文本编辑能力,通过脚本命令对输入流或文件执行查找替换、按模式删除行、打印指定行等操作,并支持 -i 就地修改文件,适用于文本批量规范化与简单内容转换。

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

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add sed-tool
Metadata
name
sed-tool
description
Stream editor for filtering and transforming text using scripts. Use for find-and-replace, text manipulation, and batch file editing.

Stream Editor

Perform basic text transformations on input streams using scripting commands. Supports find-and-replace, deletion, insertion, and conditional operations.

Usage

sed-tool [options] <script> [file...]

Common Commands

  • s/old/new/: Substitute text
  • /pattern/d: Delete matching lines
  • Np: Print line N
  • -i: Edit files in-place

Examples

# Find and replace
sed-tool 's/foo/bar/g' file.txt

# Edit in-place
sed-tool -i 's/old/new/g' config.ini

# Delete lines matching pattern
sed-tool '/debug/d' log.txt