Create New Document

The title of your document (will be displayed as H1)
URL-friendly name (no spaces, use dashes)
Path where to create document (optional, use forward slashes to create subdirectories)

Move/Rename Document

Current location of the document
New path for the document (including the slug)
This only changes the document's path. It does not modify the document's title (H1 heading).

Delete Document

Are you sure you want to delete this document? This action cannot be undone.

Warning: If this is a folder, all contents including subfolders and documents will be deleted.

Message

Message content goes here.

Confirm Action

Are you sure?

Attachments

Allowed file types: jpg, jpeg, png, gif, svg, webp, txt, log, csv, sfd, zip, pdf, docx, xlsx, pptx, mp4 (Max: 10MB)

Document Files

Loading attached files...

Document History

Previous Versions

Loading versions...

Preview

Select a version to preview

Wiki Settings

Language for the user interface
Number of versions to keep per document. Set to 0 to disable versioning.
Maximum allowed file size for uploads in MB.

User Management

Add New User

Leave empty to keep current password
Users with these groups can access restricted sections.

Define path-based access rules for sections of your wiki, then assign users to groups in the Users tab. Rules are evaluated in order. First match wins.

Active Rules

Import markdown files from a ZIP archive. Files will be processed and stored in the appropriate document structure. Directory structure in the ZIP (category/subcategory) will be preserved in the wiki.

Upload a ZIP file containing markdown (.md) files to import.

Create and manage backups of your wiki data. Backups include all documents, images, and configuration files.

Available Backups

Loading backups...

Add/Edit Access Rule

Selected: /

Add Column

Banner

mv

mv 命令常用案例

命令简介

mv 用于移动文件/目录,或重命名文件/目录。

三种使用语法

mv [选项]... [-T] 源文件 目标文件          # 单源移动/重命名
mv [选项]... 源文件... 目标目录            # 多源移动到目录
mv [选项]... -t 目标目录 源文件...         # 先指定目标目录

选项说明

选项 说明
--backup[=CONTROL] 若目标文件已存在,先备份再覆盖
-b 类似 --backup,但不接受参数
-f, --force 覆盖前不提示(强制覆盖)
-i, --interactive 覆盖前提示确认
-n, --no-clobber 不覆盖已存在的文件
--strip-trailing-slashes 移除源参数末尾的斜杠
-S, --suffix=后缀 覆盖默认的备份后缀(默认 ~
-t, --target-directory=目录 将所有源移动到指定目录
-T, --no-target-directory 将目标视为普通文件(非目录)
-u, --update 仅当源文件比目标新或目标不存在时才移动
-v, --verbose 显示正在执行的操作
-Z, --context 将目标文件的 SELinux 上下文设为默认类型
--help 显示帮助信息
--version 显示版本信息

重要规则

备份相关


常用案例

1. 重命名文件

mv oldname.txt newname.txt

2. 移动文件到目录

mv file.txt /target/directory/

3. 移动多个文件到目录

mv file1.txt file2.txt file3.txt /target/directory/

4. 移动整个目录

mv sourcedir/ /target/directory/

5. 移动并重命名(目录在同一位置即重命名)

mv /home/user/oldname /home/user/newname

6. 覆盖前提示确认

mv -i file.txt /target/
# 输出:overwrite '/target/file.txt'? y/n

7. 强制覆盖(不提示)

mv -f file.txt /target/

8. 不覆盖已存在的文件

mv -n file.txt /target/
# 若 /target/file.txt 已存在,则不做任何操作

9. 仅当源文件更新时才移动

mv -u source.txt /target/
# 仅当 source.txt 比 /target/source.txt 新,或目标不存在时才移动

10. 显示移动过程

mv -v file.txt /target/
# 输出:renamed 'file.txt' -> '/target/file.txt'

11. 移动时先备份目标文件

mv -b file.txt /target/
# 若 /target/file.txt 存在,先备份为 file.txt~

12. 使用编号备份

mv --backup=numbered file.txt /target/
# 备份为 file.txt.~1~, file.txt.~2~ 等

13. 将多个源移动到指定目录(使用 -t)

mv -t /target/dir/ file1.txt file2.txt file3.txt

14. 移动以 - 开头的文件

mv -- -file.txt ./file.txt
# 或
mv ./-file.txt ./file.txt

15. 将目录下所有文件移到上层(并清空目录)

mv sourcedir/* ./

16. 批量重命名(结合 Shell 通配符)

mv *.txt *.bak        # 注意:这样不行!会报错
# 正确方式使用循环:
for f in *.txt; do mv "$f" "${f%.txt}.bak"; done

17. 移动隐藏文件(以 . 开头)

mv .hiddenfile visiblefile

18. 将文件移动到父目录

mv file.txt ..

19. 移动并保留备份,使用自定义后缀

mv --backup -S .bak file.txt /target/
# 备份文件会命名为 file.txt.bak

注意事项

mvcp 的区别

操作 mv cp
移动/复制 移动(原位置消失) 复制(原位置保留)
磁盘空间 不占用额外空间(同文件系统内) 占用额外空间
速度 快(仅更新目录项) 慢(实际复制数据)

跨文件系统移动

当源和目标在不同文件系统时,mv 会先 cprm,相当于复制+删除,会比较慢。

覆盖风险提示

mv source.txt dest.txt   # 如果 dest.txt 存在,会被无声覆盖!
# 建议使用 -i 选项避免误操作
mv -i source.txt dest.txt

最佳实践

# 设置别名,默认使用 -i 选项,防止误覆盖
alias mv='mv -i'

Attached Files

Loading attached files...
Search Results