Manage files and folders via shell commands. Use when: user asks to create, move, copy, rename, delete, find, or organize files and directories. Also for reading file contents, checking disk usage, or comparing files. NOT for: editing code (use the editor directly).
Handle file operations efficiently using shell commands instead of GUI navigation.
| Task | Command |
|---|---|
| List files | ls -la or ls -lah for human-readable sizes |
| Find files | find /path -name "pattern" or find . -type f -name "*.py" |
| Create dir | mkdir -p /path/to/dir |
| Copy | cp -r source dest (use -r for directories) |
| Move/rename | mv source dest |
| Delete | rm file or rm -rf dir (ALWAYS confirm with user first) |
| Read file | cat file or head -50 file for previews |
| File size | du -sh /path |
| Disk usage | df -h |
| Compare | diff file1 file2 |
| Search content | grep -rn "pattern" /path |
| Count lines | wc -l file |
rm -rf without explicit user confirmationls to verify paths before destructive operationstrash command over rm if availableshell_exec for all file operations — it's faster and more
reliable than navigating Finder/Files with mouse clicks.&& for multi-step operations.tree -L 2 for a quick directory overview.