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

cp

cp 命令常用案例

命令简介

cp 用于复制文件或目录。cp的英文全称是copy

三种使用语法

cp [选项]... [-T] 源文件 目标文件          # 单源复制
cp [选项]... 源文件... 目标目录            # 多源复制到目录
cp [选项]... -t 目标目录 源文件...         # 先指定目标目录

选项说明

选项 说明
-a, --archive 归档复制,等同于 -dR --preserve=all(保留所有属性)
--attributes-only 仅复制文件属性,不复制数据内容
--backup[=CONTROL] 若目标文件已存在,先备份再覆盖
-b 类似 --backup,但不接受参数
--copy-contents 递归复制特殊文件的内容
-d 等同于 --no-dereference --preserve=links
-f, --force 若目标无法打开,删除再重试(与 -n 同时使用时忽略)
-i, --interactive 覆盖前提示确认(覆盖 -n 选项)
-H 仅跟随源中命令行指定的符号链接
-l, --link 创建硬链接而不是复制文件
-L, --dereference 总是跟随源中的符号链接
-n, --no-clobber 不覆盖已存在的文件(覆盖 -i 选项)
-P, --no-dereference 从不跟随源中的符号链接
-p 等同于 --preserve=mode,ownership,timestamps
--preserve[=属性列表] 保留指定属性(默认:模式、所有者、时间戳);可选:context、links、xattr、all
--no-preserve=属性列表 不保留指定属性
--parents 在目标目录中保留完整的源路径
-R, -r, --recursive 递归复制目录
--reflink[=WHEN] 控制写时复制(CoW)拷贝,见下方说明
--remove-destination 打开目标前先删除已存在的目标文件(与 --force 不同)
--sparse=WHEN 控制稀疏文件的创建,见下方说明
--strip-trailing-slashes 移除源参数末尾的斜杠
-s, --symbolic-link 创建符号链接而不是复制
-S, --suffix=后缀 覆盖默认的备份后缀(默认 ~
-t, --target-directory=目录 将源全部复制到指定目录
-T, --no-target-directory 将目标视为普通文件(非目录)
-u, --update 仅当源文件比目标新或目标不存在时才复制
-v, --verbose 显示正在执行的操作
-x, --one-file-system 限制在当前文件系统内
-Z 将目标文件的 SELinux 上下文设为默认类型
--context[=CTX] 类似 -Z,或指定 SELinux/SMACK 上下文
--help 显示帮助信息
--version 显示版本信息

稀疏文件说明

备份相关


常用案例

1. 复制文件到目录

cp file.txt /tmp/

2. 复制文件并重命名

cp file.txt file_backup.txt

3. 复制多个文件到目录

cp file1.txt file2.txt file3.txt /backup/

4. 递归复制整个目录

cp -r /source/dir /dest/dir

5. 归档复制(保留所有属性)

cp -a /source/dir /dest/dir

常用于备份,保留权限、所有者、时间戳等。

6. 覆盖前提示确认

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

7. 不覆盖已存在的文件

cp -n file.txt /target/

8. 仅复制更新的文件(增量复制)

cp -u source.txt dest.txt
# 仅当 source.txt 比 dest.txt 新,或 dest.txt 不存在时才复制

9. 创建硬链接(而非复制)

cp -l file.txt hardlink.txt

10. 创建符号链接

cp -s file.txt symlink.txt

11. 显示复制过程

cp -v file.txt /tmp/
# 输出:'file.txt' -> '/tmp/file.txt'

12. 复制时保留完整路径

cp --parents /path/to/source/file.txt /backup/
# 在 /backup/ 下创建 /path/to/source/file.txt

13. 复制时先备份目标文件

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

14. 使用编号备份

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

15. 仅复制文件属性(不复制内容)

cp --attributes-only file.txt newfile.txt
# 创建空文件,但保留原文件的权限和时间戳

16. 所有源复制到指定目录(使用 -t)

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

17. 强制复制(删除已存在目标后再尝试)

cp -f file.txt /target/

18. 递归复制但不跨越文件系统

cp -rx /source/ /dest/

19. 使用写时复制(CoW,适用于 Btrfs/XFS 等)

cp --reflink=always largefile.iso clone.iso
# 快速复制大文件,仅在实际修改时才占用额外空间

Attached Files

Loading attached files...
Search Results