返回顶部
m

m移动管理

Short alias skill for moving files, directories, or data; also for system management like managing services or packages. Use when relocating or reorganizing content.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
232
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

m

m(Move 简写)

这是一个快速移动/管理 Skill,用字母 m 触发。用于文件移动、目录重构,以及系统包和服务的操作。



适用场景

当你说:

  • - 移动文件到其他目录
  • 重命名文件
  • 迁移项目
  • 安装/卸载软件
  • 管理服务
  • reorganize files



文件移动

基础mv
bash
mv old.txt new.txt # 重命名
mv file.txt /path/to/dir/ # 移动到目录
mv *.tmp /trash/ # 移动所有tmp文件
mv -i file.txt backup/ # 交互模式(覆盖前确认)
mv -n file.txt backup/ # 不覆盖已存在
mv -v file.txt backup/ # 显示操作详情

批量移动
bash

按扩展名移动到子目录


mkdir -p backup && mv *.log backup/

移动并保留目录结构

find . -name *.tmp -exec mv {} tmp_files/ \;

移动并排除某些文件

rsync -av --exclude=*.log source/ dest/

跨设备移动
bash

mv 原地操作,无法跨设备


跨设备需要用cp+rm,或rsync


rsync -avh source/ /mnt/other_disk/backup/
rm -r source/ # 确认后再删


目录重构

bash

创建目录并移动


mkdir -p archives/2025 && mv *.log archives/2025/

移动目录自身

mv project /opt/projects/

批量创建并移动

for dir in */; do mkdir -p archive/$(date +%Y%m)/$dir mv $dir archive/$(date +%Y%m)/ done

包管理(m = Manage)

npm (Node.js)
bash
npm install express # 安装包
npm uninstall lodash # 卸载包
npm update # 更新所有
npm outdated # 检查过时
npm audit fix # 修复漏洞
npm ci # 根据package-lock安装(CI环境)

pip (Python)
bash
pip install django # 安装
pip uninstall numpy # 卸载
pip list --outdated # 列出过时
pip freeze > requirements.txt # 导出依赖
pip install -r requirements.txt # 批量安装
pip check # 检查依赖冲突

apt (Ubuntu/Debian)
bash
sudo apt update # 更新索引
sudo apt install nginx # 安装
sudo apt remove nginx # 卸载(保留配置)
sudo apt purge nginx # 完全卸载(含配置)
sudo apt upgrade # 升级所有
sudo apt autoremove # 清理无用依赖

yum/dnf (CentOS/RHEL/Fedora)
bash
sudo dnf install nodejs # 安装
sudo dnf remove mysql-server # 卸载
sudo dnf upgrade # 升级
sudo dnf autoremove # 清理

brew (macOS)
bash
brew install wget # 安装
brew uninstall --ignore-dependencies wget # 卸载
brew upgrade # 升级所有
brew cleanup # 清理旧版本
brew doctor # 健康检查
brew list --versions # 查看版本

chocolatey (Windows)
powershell
choco install git # 安装
choco uninstall nodejs # 卸载
choco upgrade all # 升级所有
choco list --local-only # 已安装列表



服务管理

systemd (Linux)
bash
sudo systemctl start nginx # 启动
sudo systemctl stop nginx # 停止
sudo systemctl restart nginx # 重启
sudo systemctl reload nginx # 重载配置(不中断)
sudo systemctl enable nginx # 开机自启
sudo systemctl disable nginx # 禁用自启
sudo systemctl status nginx # 查看状态
sudo systemctl is-active nginx # 是否运行
sudo systemctl is-enabled nginx # 是否启用

macOS launchd
bash
launchctl list # 列出服务
launchctl start /Library/LaunchDaemons/com.example.plist
launchctl stop com.example.service
launchctl unload ~/Library/LaunchAgents/com.example.plist

Windows Service (PowerShell)
powershell
Start-Service -Name Spooler # 启动
Stop-Service -Name Spooler # 停止
Restart-Service -Name W3SVC # 重启
Get-Service | Where {$_.Status -eq Running} # 运行中的服务
Set-Service -Name Spooler -StartupType Automatic # 设置自动



数据迁移

数据库
bash

备份+恢复


mysqldump -u root -p db > backup.sql
mysql -u root -p new_db < backup.sql

MongoDB

mongodump --archive > backup.gz mongorestore --archive < backup.gz

PostgreSQL

pg_dump db > backup.sql psql new_db < backup.sql

容器数据
bash
docker cp container:/app/data ./local_backup/
docker volumes ls # 查看卷
docker run --rm -v source:/data -v dest:/backup alpine \
cp -r /data /backup/



版本迁移

Git分支移动
bash
git branch -m old-name new-name # 重命名分支
git branch -m branch new-branch # 当前分支重命名
git branch -m main master # 主分支重命名

标签移动
bash
git tag newtag oldtag # 复制标签
git tag -d old_tag # 删除旧标签
git push origin :oldtag newtag # 更新远程



实用技巧

原子移动(避免中断)
bash

重命名目录(原子操作)


mv tempdir finalname # 瞬间完成,用户无感知

增量更新(rsync比mv更安全)

rsync -av --delete source/ dest/

移动前验证
bash
if [ -d source ]; then
echo Source exists
mv source dest/
else
echo Source not found
fi

跨平台移动脚本
bash
#!/usr/bin/env bash

m 移动文件,支持通配符


src=$1
dest=$2

if [ -z $src ] || [ -z $dest ]; then
echo Usage: m
exit 1
fi

if [ ! -e $src ]; then
echo Error: $src does not exist
exit 1
fi

mv $src $dest && echo Moved: $src -> $dest



操作类型推荐命令替代方案
文件移动mvrsync(跨设备)
目录移动
mv -T | rsync -a |
| 包安装 | 各包管理器 | 手动编译 |
| 服务重启 | systemctl restart | kill + start |


m 技能是组织和管理的主力。 mv 操作请三思:确认目标存在,确认空间足够,确认不会覆盖重要数据。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 m-1776117449 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 m-1776117449 技能

通过命令行安装

skillhub install m-1776117449

下载

⬇ 下载 m v1.0.0(免费)

文件大小: 3.38 KB | 发布时间: 2026-4-15 13:18

v1.0.0 最新 2026-4-15 13:18
- Initial release of the *m* skill as a concise alias for move/manage operations.
- Supports file and directory relocation, including renaming, bulk moves, and atomic operations.
- Adds guidance for system package management (npm, pip, apt, dnf, brew, choco) and service management (systemd, launchd, Windows Services).
- Provides database and container data migration commands.
- Includes practical scripts and safety tips for moving content and reorganizing directories.
- Suitable for file reorganization, system package/service tasks, project migration, and related management scenarios.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部