Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

fd-file-findingfd 文件查找

Agent Skill

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

总安装

1,082

周安装

46

GitHub Stars

28

下载量

379
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/laurigates/claude-plugins --skill fd-file-finding

简介

fd-file-finding 提供 fd 工具的专家级用法,替代 find 实现高速文件搜索与智能过滤。

  • 适用于按名称、类型、修改时间与大小定位文件,支持正则匹配与多条件组合查询。
  • 通过 npx skills add 命令安装,优先用于代码审计与批量文件操作前的快速发现阶段。
  • 执行前应确认搜索范围与权限边界,避免遍历敏感目录或触发大规模 I/O 操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

fd File Finding

Expert knowledge for using fd as a fast, user-friendly alternative to find with smart defaults and powerful filtering.

When to Use This Skill

Use this skill when...Use rg-code-search instead when...
Finding files by name, extension, or path patternSearching inside file contents for text or regex
Filtering by mtime (--changed-within) or size (--size)Filtering matches by file type (-t py, -t js)
Locating files to feed into -x / -X executionAuditing source code for patterns across many files
Use this skill when...Use jq-json-processing instead when...
Discovering JSON, YAML, or other files on diskQuerying or transforming the contents of those files
Building a file list for downstream batch processingExtracting fields, filtering arrays, or reshaping JSON

Core Expertise

fd Advantages

  • Fast parallel execution (written in Rust)
  • Colorized output by default
  • Respects .gitignore automatically
  • Smart case-insensitive search
  • Simpler syntax than find
  • Regular expression support

Basic Usage

Simple File Search

# Find all files named config
fd config

# Find files with extension
fd -e rs                    # All Rust files
fd -e md                    # All Markdown files
fd -e js -e ts              # JavaScript and TypeScript

# Case-sensitive search
fd -s Config                # Only exact case match

Pattern Matching

# Regex patterns
fd '^test_.*\.py$'          # Python test files
fd '\.config$'              # Files ending in .config
fd '^[A-Z]'                 # Files starting with uppercase

# Glob patterns
fd '*.lua'                  # All Lua files
fd 'test-*.js'              # test-*.js files

Advanced Filtering

Type Filtering

# Search only files
fd -t f pattern             # Files only
fd -t d pattern             # Directories only
fd -t l pattern             # Symlinks only
fd -t x pattern             # Executable files

# Multiple types
fd -t f -t l pattern        # Files and symlinks

Depth Control

# Limit search depth
fd -d 1 pattern             # Only current directory
fd -d 3 pattern             # Max 3 levels deep
fd --max-depth 2 pattern    # Alternative syntax

# Minimum depth
fd --min-depth 2 pattern    # Skip current directory

Hidden and Ignored Files

# Include hidden files
fd -H pattern               # Include hidden files (starting with .)

# Include ignored files
fd -I pattern               # Include .gitignore'd files
fd -u pattern               # Unrestricted: hidden + ignored

# Show all files
fd -H -I pattern            # Show everything

Size Filtering

# File size filters
fd --size +10m              # Files larger than 10 MB
fd --size -1k               # Files smaller than 1 KB
fd --size +100k --size -10m # Between 100 KB and 10 MB

Modification Time

# Files modified recently
fd --changed-within 1d      # Last 24 hours
fd --changed-within 2w      # Last 2 weeks
fd --changed-within 3m      # Last 3 months

# Files modified before
fd --changed-before 1y      # Older than 1 year

Execution and Processing

Execute Commands

# Execute command for each result
fd -e jpg -x convert {} {.}.png     # Convert all JPG to PNG

# Parallel execution
fd -e rs -x rustfmt                 # Format all Rust files

# Execute with multiple results
fd -e md -X wc -l                   # Word count on all Markdown files

Output Formatting

# Custom output format using placeholders
fd -e tf --format '{//}'            # Parent directory of each file
fd -e rs --format '{/}'             # Filename without directory
fd -e md --format '{.}'             # Path without extension

# Placeholders:
# {}   - Full path (default)
# {/}  - Basename (filename only)
# {//} - Parent directory
# {.}  - Path without extension
# {/.} - Basename without extension

Integration with Other Tools

# Prefer fd's native execution over xargs when possible:
fd -e log -x rm                     # Delete all log files (native)
fd -e rs -X wc -l                   # Count lines in Rust files (batch)

# Use with rg for powerful search
fd -e py -x rg "import numpy" {}    # Find numpy imports in Python files

# Open files in editor
fd -e md -X nvim                    # Open all Markdown in Neovim (batch)

# When xargs IS useful: complex pipelines or non-fd inputs
cat filelist.txt | xargs rg "TODO"  # Process file from external list

Common Patterns

Development Workflows

# Find test files
fd -e test.js -e spec.js            # JavaScript tests
fd '^test_.*\.py$'                  # Python tests
fd '_test\.go$'                     # Go tests

# Find configuration files
fd -g '*.config.js'                 # Config files
fd -g '.env*'                       # Environment files
fd -g '*rc' -H                      # RC files (include hidden)

# Find source files
fd -e rs -e toml -t f               # Rust project files
fd -e py --exclude __pycache__      # Python excluding cache
fd -e ts -e tsx src/                # TypeScript in src/

Cleanup Operations

# Find and remove
fd -e pyc -x rm                     # Remove Python bytecode
fd node_modules -t d -x rm -rf      # Remove node_modules
fd -g '*.log' --changed-before 30d -X rm  # Remove old logs

# Find large files
fd --size +100m -t f                # Files over 100 MB
fd --size +1g -t f -x du -h         # Size of files over 1 GB

Path-Based Search

# Search in specific directories
fd pattern src/                     # Only in src/
fd pattern src/ tests/              # Multiple directories

# Exclude paths
fd -e rs -E target/                 # Exclude target directory
fd -e js -E node_modules -E dist    # Exclude multiple paths

# Full path matching
fd -p src/components/.*\.tsx$       # Match full path

Find Directories Containing Specific Files

# Find all directories with Terraform configs
fd -t f 'main\.tf$' --format '{//}'

# Find all directories with package.json
fd -t f '^package\.json$' --format '{//}'

# Find Go module directories
fd -t f '^go\.mod$' --format '{//}'

# Find Python project roots (with pyproject.toml)
fd -t f '^pyproject\.toml$' --format '{//}'

# Find Cargo.toml directories (Rust projects)
fd -t f '^Cargo\.toml$' --format '{//}'

Note: Use --format '{//}' instead of piping to xargs - it's faster and simpler.

Best Practices

When to Use fd

  • Finding files by name or pattern
  • Searching with gitignore awareness
  • Fast directory traversal
  • Type-specific searches
  • Time-based file queries

When to Use find Instead

  • Complex boolean logic
  • POSIX compatibility required
  • Advanced permission checks
  • Non-standard file attributes

Performance Tips

  • Use -j 1 for sequential search if order matters
  • Combine with --max-depth to limit scope
  • Use -t f to skip directory processing
  • Leverage gitignore for faster searches in repos

Integration with rg

# Prefer native execution over xargs
fd -e py -x rg "class.*Test" {}     # Find test classes in Python
fd -e rs -x rg "TODO" {}            # Find TODOs in Rust files
fd -e md -x rg "# " {}              # Find headers in Markdown

Use fd's Built-in Execution

# fd can execute directly — no need for xargs
fd -t f 'main\.tf$' --format '{//}'    # Find dirs containing main.tf
fd -e log -x rm                         # Delete all .log files

Quick Reference

Essential Options

OptionPurposeExample
-e EXTFilter by extensionfd -e rs
-t TYPEFilter by type (f/d/l/x)fd -t d
-d DEPTHMax search depthfd -d 3
-HInclude hidden filesfd -H.env
-IInclude ignored filesfd -I build
-uUnrestricted (no ignore)fd -u pattern
-E PATHExclude pathfd -E node_modules
-x CMDExecute commandfd -e log -x rm
-X CMDBatch executefd -e md -X cat
-sCase-sensitivefd -s Config
-g GLOBGlob patternfd -g '*.json'
--format FMTCustom output formatfd -e tf --format '{//}'

Time Units

  • s = seconds
  • m = minutes
  • h = hours
  • d = days
  • w = weeks
  • y = years

Size Units

  • b = bytes
  • k = kilobytes
  • m = megabytes
  • g = gigabytes
  • t = terabytes

Common Command Patterns

# Find recently modified source files
fd -e rs --changed-within 1d

# Find large files in current directory
fd -d 1 -t f --size +10m

# Find executable scripts
fd -t x -e sh

# Find config files including hidden
fd -H -g '*config*'

# Find and count lines
fd -e py -X wc -l

# Find files excluding build artifacts
fd -e js -E dist -E node_modules -E build

# Find all Terraform/IaC project directories
fd -t f 'main\.tf$' --format '{//}'

# Find all Node.js project roots
fd -t f '^package\.json$' --format '{//}'

This makes fd the preferred tool for fast, intuitive file finding in development workflows.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.48%
按下载量换算134

Claude

30.02%
按下载量换算114

Cursor

17.01%
按下载量换算64

Gemini CLI

10.35%
按下载量换算39

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills