filesystemPerform advanced filesystem tasks including listing, recursive searching by name or content, batch copying/moving/deleting files, and analyzing directory siz...
Install via ClawdBot CLI:
clawdbot install AmaoFx/filesystem文件系统操作工具,提供目录列表、内容搜索、批量处理和目录分析功能。
# 列出当前目录
ls -la
# 递归列出目录树
find . -type f -name "*.md" | head -20
# 按类型过滤
find . -type f \( -name "*.md" -o -name "*.txt" \)
# 按名称搜索
find . -name "*keyword*"
# 按内容搜索
grep -r "keyword" . --include="*.md"
# 不区分大小写搜索
grep -ri "keyword" . --include="*.md"
# 统计文件类型
find . -type f -name "*.md" | wc -l
# 查看目录大小
du -sh .
# 找出最大文件
find . -type f -exec ls -lh {} \; | sort -k5 -h | head -10
基础列表:
ls -la # 详细列表
ls -lh # 人类可读大小
ls -lt # 按修改时间排序
ls -R # 递归列表
高级列表:
# 列出特定类型
find . -type f -name "*.md"
# 按深度列出
find . -maxdepth 2 -type f
# 排除特定目录
find . -type f -not -path "*/node_modules/*"
按名称搜索:
# 精确匹配
find . -name "filename.md"
# 模式匹配
find . -name "*pattern*"
# 大小写不敏感
find . -iname "*pattern*"
按内容搜索:
# 基础搜索
grep -r "keyword" .
# 包含行号
grep -rn "keyword" .
# 只搜索特定文件
grep -r "keyword" . --include="*.md"
# 排除目录
grep -r "keyword" . --exclude-dir=node_modules
正则表达式搜索:
# 使用正则
grep -r "^## " . --include="*.md"
# 多个关键词
grep -r "key1\|key2" .
# 行首/行尾
grep -r "^关键词" .
grep -r "关键词$" .
批量复制:
# 复制特定类型
find . -name "*.md" -exec cp {} backup/ \;
# 复制到多个位置
for file in *.md; do cp "$file" dir1/ && cp "$file" dir2/; done
批量移动:
# 移动特定文件
find . -name "*.log" -exec mv {} logs/ \;
# 按条件移动
find . -type f -size +1M -exec mv {} large/ \;
批量删除:
# 删除特定类型
find . -name "*.tmp" -delete
# 删除空目录
find . -type d -empty -delete
# 删除旧文件
find . -type f -mtime +30 -delete
批量重命名:
# 使用 rename 命令
rename 's/old/new/' *.md
# 添加前缀
for file in *.md; do mv "$file" "prefix_$file"; done
大小分析:
# 总大小
du -sh .
# 各目录大小
du -h --max-depth=1 . | sort -hr
# 最大的文件
find . -type f -exec ls -lh {} \; | sort -k5 -hr | head -10
文件类型统计:
# 按扩展名统计
find . -type f -name "*.md" | wc -l
# 各类型统计
find . -type f -name "*.*" | sed 's/.*\.//' | sort | uniq -c
目录结构分析:
# 目录树
tree -L 2
# 递归深度
find . -type d | wc -l
# 文件分布
find . -type f | cut -d/ -f1-2 | sort | uniq -c
文件详情:
# 完整信息
stat filename
# 只看大小
ls -lh filename
# 只看时间
ls -lt filename
文件内容预览:
# 头部
head -20 filename
# 尾部
tail -20 filename
# 随机行
shuf -n 10 filename
# 字符数
wc -c filename
# 行数
wc -l filename
# 安装
brew install tree
# 使用
tree -L 2 -I 'node_modules|__pycache__'
# 安装
brew install fd
# 使用
fd "pattern" /path
fd -e md . # 只找 md 文件
fd -t f . # 只找文件
# 安装
brew install ripgrep
# 使用
rg "keyword" .
rg -t md "keyword" .
rg -i "keyword" . # 不区分大小写
rg --type md "pattern" .
fd 或 ripgrep 替代 find 和 grep(更快)--dry-run 查看会发生什么-max-depth 限制递归深度-size 过滤大文件-mtime 按时间筛选# 查找所有 md 文件
find . -name "*.md" -type f
# 统计 md 文件数量
find . -name "*.md" | wc -l
# 列出最大的 md 文件
find . -name "*.md" -exec ls -lh {} \; | sort -k5 -hr | head -5
# 搜索所有匹配项
grep -rn "old_text" . --include="*.md"
# 替换(使用 sed)
find . -name "*.md" -exec sed -i '' 's/old_text/new_text/g' {} \;
# 删除 .tmp 文件
find . -name "*.tmp" -delete
# 删除空目录
find . -type d -empty -delete
# 删除 30 天前的日志
find . -name "*.log" -mtime +30 -delete
⚠️ 批量操作前先确认:
⚠️ 删除操作不可逆:
rm 删除后无法恢复rm -i 交互式删除⚠️ 权限注意:
Generated Feb 26, 2026
A digital media company uses the skill to manage large repositories of markdown and text files. They perform recursive searches for outdated content, batch rename files for SEO optimization, and analyze directory structures to identify unused assets for cleanup, improving site performance.
A software development team leverages the skill to analyze codebases by searching for specific patterns or keywords across source files, counting file types to assess project composition, and cleaning up temporary or log files to maintain repository hygiene and reduce storage costs.
A financial institution employs the skill to locate and batch process old log files and documents based on modification time, ensuring compliance with data retention policies. They use size analysis to monitor storage usage and move files to archival systems securely.
Researchers in academia use the skill to search through large datasets of text files for specific terms, organize findings into structured directories, and perform batch operations to standardize file naming conventions, facilitating collaboration and data sharing.
An e-commerce platform utilizes the skill to manage product description files in markdown format. They search and replace outdated pricing or keywords, analyze file sizes to optimize loading times, and batch copy updated files across multiple server directories for consistency.
Offer a cloud-based service that integrates these filesystem operations into a user-friendly interface, targeting businesses needing automated file organization and analysis. Revenue is generated through subscription tiers based on storage limits and advanced features like AI-powered search.
Provide tailored solutions for enterprises to automate specific filesystem tasks, such as batch processing or directory analysis, improving operational efficiency. Revenue comes from project-based fees and ongoing maintenance contracts.
Develop a desktop app that bundles these command-line tools into a graphical interface for non-technical users, with basic features free and premium features like advanced analytics or batch operations locked behind a one-time purchase or subscription.
💬 Integration Tip
Integrate this skill into existing workflows by wrapping commands in scripts or APIs, and consider using tools like fd or ripgrep for faster performance in production environments.
Advanced filesystem operations - listing, searching, batch processing, and directory analysis for Clawdbot
Essential SSH commands for secure remote access, key management, tunneling, and file transfers.
Extract text from PDF files for LLM processing
The directory for AI agent services. Discover tools, platforms, and infrastructure built for agents.
Advanced filesystem operations - listing, searching, batch processing, and directory analysis for Clawdbot
Backup agent brain (workspace) and body (state) to local folder and optionally sync to cloud via rclone.