Loading...
Loading...
File management skill. Used for creating, moving, copying, deleting files and folders, and organizing directory structures. It is applicable when users need to manage files, organize folders, or process files in batches.
npx skill4agent add rtgs2017/nagaagent file-manager# 1. 创建分类目录
mkdir -p ~/Downloads/{Documents,Images,Videos,Archives,Others}
# 2. 按扩展名移动
mv ~/Downloads/*.pdf ~/Downloads/Documents/
mv ~/Downloads/*.{jpg,png,gif} ~/Downloads/Images/
mv ~/Downloads/*.{mp4,mov,avi} ~/Downloads/Videos/
mv ~/Downloads/*.{zip,rar,7z} ~/Downloads/Archives/import os
from pathlib import Path
def batch_rename(directory, pattern, replacement):
for file in Path(directory).iterdir():
if pattern in file.name:
new_name = file.name.replace(pattern, replacement)
file.rename(file.parent / new_name)即将执行以下操作:
- 移动 15 个 PDF 文件到 Documents/
- 移动 23 个图片文件到 Images/
- 跳过 3 个未知类型文件
确认执行?✓ 操作完成
- 移动: 38 个文件
- 跳过: 3 个文件
- 错误: 0 个