Agent Skillspenpot/penpot › fd-find

fd-find

GitHub

fd 是 find 命令的快速友好替代品,支持智能默认值、gitignore 忽略、扩展名/类型/时间/大小过滤及正则匹配。适用于高效文件搜索与批量操作。

.opencode/skills/fd-find/SKILL.md penpot/penpot

触发场景

需要查找文件或目录 根据扩展名或类型筛选文件 基于时间或大小过滤文件 执行批量文件操作

安装

npx skills add penpot/penpot --skill fd-find -g -y
更多选项

非标准路径

npx skills add https://github.com/penpot/penpot/tree/develop/.opencode/skills/fd-find -g -y

不安装直接使用

npx skills use penpot/penpot@fd-find

指定 Agent (Claude Code)

npx skills add penpot/penpot --skill fd-find -a claude-code -g -y

安装 repo 全部 skill

npx skills add penpot/penpot --all -g -y

预览 repo 内 skill

npx skills add penpot/penpot --list

SKILL.md

Frontmatter
{
    "name": "fd-find",
    "homepage": "https:\/\/github.com\/sharkdp\/fd",
    "metadata": {
        "clawdbot": {
            "emoji": "📂",
            "install": [
                {
                    "id": "brew",
                    "bins": [
                        "fd"
                    ],
                    "kind": "brew",
                    "label": "Install fd (brew)",
                    "formula": "fd"
                },
                {
                    "id": "apt",
                    "bins": [
                        "fd"
                    ],
                    "kind": "apt",
                    "label": "Install fd (apt)",
                    "package": "fd-find"
                }
            ],
            "requires": {
                "bins": [
                    "fd"
                ]
            }
        }
    },
    "description": "A fast and user-friendly alternative to 'find' - simple syntax, smart defaults, respects gitignore."
}

fd - Fast File Finder

User-friendly alternative to find with smart defaults.

Quick Start

Basic search

# Find files by name
fd pattern

# Find in specific directory
fd pattern /path/to/dir

# Case-insensitive
fd -i pattern

Common patterns

# Find all Python files
fd -e py

# Find multiple extensions
fd -e py -e js -e ts

# Find directories only
fd -t d pattern

# Find files only
fd -t f pattern

# Find symlinks
fd -t l

Advanced Usage

Filtering

# Exclude patterns
fd pattern -E "node_modules" -E "*.min.js"

# Include hidden files
fd -H pattern

# Include ignored files (.gitignore)
fd -I pattern

# Search all (hidden + ignored)
fd -H -I pattern

# Maximum depth
fd pattern -d 3

Execution

# Execute command on results
fd -e jpg -x convert {} {.}.png

# Parallel execution
fd -e md -x wc -l

# Use with xargs
fd -e log -0 | xargs -0 rm

Regex patterns

# Full regex search
fd '^test.*\.js$'

# Match full path
fd --full-path 'src/.*/test'

# Glob pattern
fd -g "*.{js,ts}"

Time-based filtering

# Modified within last day
fd --changed-within 1d

# Modified before specific date
fd --changed-before 2024-01-01

# Created recently
fd --changed-within 1h

Size filtering

# Files larger than 10MB
fd --size +10m

# Files smaller than 1KB
fd --size -1k

# Specific size range
fd --size +100k --size -10m

Output formatting

# Absolute paths
fd --absolute-path

# List format (like ls -l)
fd --list-details

# Null separator (for xargs)
fd -0 pattern

# Color always/never/auto
fd --color always pattern

Common Use Cases

Find and delete old files:

fd --changed-before 30d -t f -x rm {}

Find large files:

fd --size +100m --list-details

Copy all PDFs to directory:

fd -e pdf -x cp {} /target/dir/

Count lines in all Python files:

fd -e py -x wc -l | awk '{sum+=$1} END {print sum}'

Find broken symlinks:

fd -t l -x test -e {} \; -print

Search in specific time window:

fd --changed-within 2d --changed-before 1d

Integration with other tools

With ripgrep:

fd -e js | xargs rg "pattern"

With fzf (fuzzy finder):

vim $(fd -t f | fzf)

With bat (cat alternative):

fd -e md | xargs bat

Performance Tips

  • fd is typically much faster than find
  • Respects .gitignore by default (disable with -I)
  • Uses parallel traversal automatically
  • Smart case: lowercase = case-insensitive, any uppercase = case-sensitive

Tips

  • Use -t for type filtering (f=file, d=directory, l=symlink, x=executable)
  • -e for extension is simpler than -g "*.ext"
  • {} in -x commands represents the found path
  • {.} strips the extension
  • {/} gets basename, {//} gets directory

Documentation

GitHub: https://github.com/sharkdp/fd Man page: man fd

版本历史

  • 2dcf1a8 当前 2026-08-20 19:20

同 Skill 集合

.opencode/skills/bat-cat/SKILL.md
.opencode/skills/code-review-and-quality/SKILL.md
.opencode/skills/code-review/SKILL.md
.opencode/skills/create-commit/SKILL.md
.opencode/skills/create-issue/SKILL.md
.opencode/skills/create-pr/SKILL.md
.opencode/skills/jq-json-processor/SKILL.md
.opencode/skills/nrepl-eval/SKILL.md
.opencode/skills/plan-review/SKILL.md
.opencode/skills/planner/SKILL.md
.opencode/skills/refine-prompt/SKILL.md
.opencode/skills/ripgrep/SKILL.md
.opencode/skills/security-and-hardening/SKILL.md
.opencode/skills/taiga/SKILL.md
.opencode/skills/testing/SKILL.md
.opencode/skills/update-changelog/SKILL.md
.opencode/skills/ste/SKILL.md

元信息

文件数
0
版本
2ce202c
Hash
5e69a68c
收录时间
2026-08-20 19:20

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-16 20:14
浙ICP备14020137号-1