用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-bash-shell --skill file-operations命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Production-grade Bash fundamentals - syntax, variables, control flow, functions
基于 SOC 职业分类
正在显示 SKILL.md
| name | file-operations |
| description | Production-grade file operations - permissions, find, archives, rsync |
| sasmp_version | 1.3.0 |
| bonded_agent | 03-file-operations |
| bond_type | PRIMARY_BOND |
| version | 2.0.0 |
| difficulty | intermediate |
| estimated_time | 5-7 hours |
Master 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 -rf