用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agentic-collections --skill sed命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Usage for basic Git operations and repository management. This is the core skill for all git interactions. You MUST load this skill when using git command-line.
Create, update, and maintain robust devcontainer.json configurations and lifecycle scripts for reproducible development environments.
Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.
基于 SOC 职业分类
正在显示 SKILL.md
| name | sed |
| description | Fast, non-interactive text stream editing and precise file segment extraction using sed. |
| license | MIT |
Fast, non-interactive text stream editing and precise file segment extraction using sed.
python or vim-ex instead).ex (Vim) or Python scripting is more robust.jq/yq instead—structured-data-aware tools are significantly safer).sed syntax. Do not use interactive tools.-i (in-place) first if modifying files, or strictly use read-only modes like -n.Use this to extract a precise segment of a file (e.g., lines 80 to 95) without dumping the whole file.
sed -n '80,95p' <file>
Extract text between two known boundary strings (inclusive).
sed -n '/START_PATTERN/,/END_PATTERN/p' <file>
sed 's/old/new/' <file>
sed 's/old/new/g' <file>
Remove leading and trailing whitespace from each line. Note: \t for tabs is a GNU extension; use literal tabs or [[:blank:]] for portability.
# Trim leading spaces and tabs (GNU)
sed -e 's/^[ \t]*//g' <file>
# Trim trailing spaces and tabs (GNU)
sed -e 's/[ \t]*$//g' <file>
# Combined trim (Portable/POSIX)
sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//' <file>
Note: \u and \U are GNU sed extensions and are not portable (e.g., on macOS/BSD).
# Capitalize first character of each line (GNU)
sed 's/./\u&/' <file>
# Capitalize first character of every word (GNU)
sed -E 's/\b[a-z]/\U&/g' <file>
# Swap first and last characters of each line (Extended Regex)
# Handles 2+ characters; 1-character lines remain unchanged.
sed -E 's/(.)(.*)(.)/\3\2\1/' <file>
# Remove all XML/HTML tags
sed -e 's/<[^>]*>//g' <file>
# Convert XML/HTML tags to newlines (GNU: \n)
# Portable sed requires a literal escaped newline in the replacement.
sed -e 's/<[^>]*>/\n/g' <file>
# WIF to SHA (part of a pipeline)
base58 -d | xxd -p -c200 | sed s/^80// | rg -oz "[A-Fa-f0-9]{64}"
# Recursive directory tree visualization (simplified)
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
# List 40 largest files (recursive) - more precise than ls -R
find . -type f -exec du -h {} + | sort -hr | head -n40
# MySQL Collation Fix (Use with caution: may downgrade utf8mb4 to utf8)
# Only use if the target database does not support utf8mb4.
sed "s/utf8mb4_0900_ai_ci\|utf8mb4_unicode_ci/utf8_general_ci/g;s/\butf8mb[34]/utf8/g" <dump.sql>
When modifying files directly, use -i (or -i.bak to create backups on some OS). Note: GNU sed supports -i directly, but macOS/BSD sed requires -i ''.
# GNU sed (Linux)
sed -i 's/old/new/g' <file>
sed -n: Always suppress default output when extracting segments to prevent flooding the terminal.'...' for sed commands to avoid shell expansion issues, unless you intentionally need variable expansion (in which case use double quotes "..." carefully).sed: macOS sed -i requires an extension argument (like sed -i '' 's/old/new/g' file), whereas Linux (GNU) sed allows -i without an extension. Since the agent primarily runs on Linux, sed -i is usually safe, but be cautious of cross-platform scripts.sed uses Basic Regular Expressions (BRE). You must escape +, ?, |, (, ), {, }. To use Extended Regular Expressions (ERE), pass the -E flag (e.g., sed -E 's/(foo|bar)/baz/g').sed to edit JSON, YAML, or XML files when structured tools like jq or yq are available.sed to edit source code AST when specialized formatting/refactoring tools exist.