Production-grade file operations - permissions, find, archives, rsync
Execute production-grade file operations including permissions, searching, archives, and synchronization. Use when you need to manage file permissions, search for files with find/fd, create/extract tar/zip archives, or sync directories with rsync.
/plugin marketplace add pluginagentmarketplace/custom-plugin-bash-shell/plugin install custom-plugin-bash-shell@pluginagentmarketplace-bash-shellThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyMaster file system operations with production-ready patterns
After completing this skill, you will be able to:
# Numeric notation
chmod 755 script.sh # rwxr-xr-x
chmod 644 file.txt # rw-r--r--
chmod 600 secret.key # rw-------
# Symbolic notation
chmod u+x script.sh # Add execute for owner
chmod g-w file.txt # Remove write for group
chmod a+r public.txt # Add read for all
# Ownership
chown user:group file
chown -R user:group dir/
# Common patterns
chmod 600 ~/.ssh/id_rsa # SSH private key
chmod 755 /var/www/html/ # Web directory
# By name
find . -name "*.txt"
find . -iname "*.TXT" # Case insensitive
# By type
find . -type f # Files
find . -type d # Directories
find . -type l # Symlinks
# By size/time
find . -size +100M # Larger than 100MB
find . -mtime -7 # Modified in 7 days
# Actions
find . -name "*.tmp" -delete
find . -type f -exec chmod 644 {} +
# Create archives
tar -cvf archive.tar dir/
tar -czvf archive.tar.gz dir/ # gzip
tar -cjvf archive.tar.bz2 dir/ # bzip2
# Extract archives
tar -xvf archive.tar
tar -xzvf archive.tar.gz -C /dest/
# ZIP
zip -r archive.zip dir/
unzip archive.zip
# Local sync
rsync -avz source/ dest/
# Remote sync
rsync -avz local/ user@host:/remote/
# With delete (mirror)
rsync -avz --delete source/ dest/
# Dry run
rsync -avzn source/ dest/
# With confirmation
rm -i file.txt
# With variable check
rm -rf "${DIR:?}/" # Fails if DIR empty
# Timestamped backup
backup() {
local src="$1"
local timestamp=$(date +%Y%m%d_%H%M%S)
cp -a "$src" "${src}.${timestamp}.bak"
}
# Fix permissions
find /var/www -type d -exec chmod 755 {} +
find /var/www -type f -exec chmod 644 {} +
# Delete old files
find /tmp -type f -mtime +7 -delete
| Don't | Do | Why |
|---|---|---|
rm -rf $VAR/ | rm -rf "${VAR:?}/" | Empty VAR = delete / |
find | xargs rm | find -delete | Handles spaces |
cp -r for sync | rsync -a | rsync is smarter |
| Error | Cause | Fix |
|---|---|---|
Permission denied | Wrong permissions | Check with ls -la |
No such file | Path typo | Verify path exists |
Directory not empty | rm without -r | Add -r flag |
Cross-device link | Hard link across fs | Use symlink |
# Check permissions
stat file.txt
ls -la file.txt
# Trace find
find . -name "*.txt" -print
# Dry-run rsync
rsync -avzn source/ dest/
--delete first"$path"rm -rfThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.