Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问clear审计异常

file-operations文件操作

Agent Skill

file-operations 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,259

周安装

53

GitHub Stars

34

下载量

441
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:file-operations(文件操作)
来源仓库:https://github.com/chaterm/terminal-skills
仓库路径:skills/file-operations
安装命令:
npx skills add https://github.com/chaterm/terminal-skills --skill file-operations
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/chaterm/terminal-skills --skill file-operations

简介

file-operations 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据任务场景快速定位内容。
  • 通过 npx skills add 命令从指定仓库安装并使用。
  • 建议确认权限范围和维护状态,注意是否触发联网或文件读写操作。
  • 可结合原始 README 进一步核验具体用法和功能边界。

SKILL.md

File and Directory Operations

Overview

Linux file system operation skills, including file search, batch operations, permission management, etc.

File Search

find Command

# Search by name
find /path -name "*.log"
find /path -iname "*.LOG"           # Case insensitive

# Search by type
find /path -type f                  # Files
find /path -type d                  # Directories
find /path -type l                  # Symbolic links

# Search by time
find /path -mtime -7                # Modified within 7 days
find /path -mtime +30               # Modified more than 30 days ago
find /path -mmin -60                # Modified within 60 minutes

# Search by size
find /path -size +100M              # Larger than 100MB
find /path -size -1k                # Smaller than 1KB

# Combined conditions
find /path -name "*.log" -mtime +7 -size +10M

locate Command

# Quick search (requires database update)
locate filename
updatedb                            # Update database

# Case insensitive
locate -i filename

File Operations

Basic Operations

# Copy
cp file1 file2
cp -r dir1 dir2                     # Recursive copy directory
cp -p file1 file2                   # Preserve attributes

# Move/Rename
mv file1 file2
mv file1 /path/to/dest/

# Delete
rm file
rm -rf dir                          # Recursive force delete
rm -i file                          # Interactive confirmation

# Create
touch file                          # Create empty file
mkdir -p dir1/dir2/dir3             # Recursive create directories

Batch Operations

# Batch rename
rename 's/old/new/' *.txt
for f in *.txt; do mv "$f" "${f%.txt}.md"; done

# Batch delete
find /path -name "*.tmp" -delete
find /path -name "*.log" -mtime +30 -exec rm {} \;

# Batch copy
find /src -name "*.conf" -exec cp {} /dest/ \;

File Content

View Files

cat file                            # Full content
head -n 20 file                     # First 20 lines
tail -n 20 file                     # Last 20 lines
tail -f file                        # Real-time follow
less file                           # Paginated view

# Statistics
wc -l file                          # Line count
wc -w file                          # Word count
wc -c file                          # Byte count

File Comparison

diff file1 file2
diff -u file1 file2                 # Unified format
diff -r dir1 dir2                   # Compare directories

# Side-by-side comparison
sdiff file1 file2
vimdiff file1 file2

Permission Management

View Permissions

ls -la
stat file

Modify Permissions

# Numeric mode
chmod 755 file                      # rwxr-xr-x
chmod 644 file                      # rw-r--r--

# Symbolic mode
chmod u+x file                      # Add execute for user
chmod g-w file                      # Remove write for group
chmod o=r file                      # Set read-only for others
chmod a+r file                      # Add read for all

# Recursive modify
chmod -R 755 dir

Modify Owner

chown user file
chown user:group file
chown -R user:group dir             # Recursive modify

Common Scenarios

Scenario 1: Clean Up Large Files

# Find files larger than 100MB
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null

# Find and sort by size
du -ah /path | sort -rh | head -20

Scenario 2: Find Recently Modified Files

# Files modified within 24 hours
find /path -type f -mtime -1

# Sort by modification time
ls -lt /path | head -20

Scenario 3: Batch Replace File Content

# Single file replacement
sed -i 's/old/new/g' file

# Batch replacement
find /path -name "*.conf" -exec sed -i 's/old/new/g' {} \;

Troubleshooting

ProblemSolution
Permission deniedUse sudo or check file permissions
Disk space fulldf -h, du -sh * to find large files
Special characters in filenameUse quotes or escape rm "file name"
Slow deletion of many filesUse rsync --delete or find -delete

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.97%
按下载量换算123

OpenCode

25.88%
按下载量换算114

windsurf

19.04%
按下载量换算84

Codex

14.98%
按下载量换算66

github-copilot

7.72%
按下载量换算34

Antigravity

3.24%
按下载量换算14

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills