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

Permission denied

在需要 root 权限的目录写文件,非root用户权限不足使用下面方法

这个错误和之前遇到的一样:重定向 >> 不受 sudo 控制

sudo echo "今年天气很好" >> b.txt

执行流程:

  1. sudo 只对 echo 命令生效(root 权限执行 echo)
  2. >> b.txt 重定向由 当前 shell 执行(你的普通用户)
  3. 当前用户在 /opt 目录没有写权限 → Permission denied

✅ 解决方案

方法1:使用 sudo tee(最推荐)

echo "今年天气很好" | sudo tee -a b.txt

方法2:使用 sudo bash -c

sudo bash -c 'echo "今年天气很好" >> b.txt'

方法3:使用 sudo sh -c

sudo sh -c 'echo "今年天气很好" >> b.txt'

📊 对比验证

# ❌ 错误(你用的)
sudo echo "内容" >> b.txt
# 重定向没有 root 权限

# ✅ 正确
echo "内容" | sudo tee -a b.txt
# tee 以 root 权限打开文件

# ✅ 也可以
sudo bash -c 'echo "内容" >> b.txt'
# 整个命令都在 root 下执行

🔧 快速测试

# 当前目录是 /opt
pwd
# /opt

# 查看权限
ls -ld /opt
# drwxr-xr-x ... root root ... /opt
# 普通用户没有写权限

# 正确写入
echo "今年天气很好" | sudo tee -a b.txt

# 验证
cat b.txt
# 今年天气很好

# 再追加一条
echo "今天温度28度" | sudo tee -a b.txt

# 查看
cat b.txt
# 今年天气很好
# 今天温度28度

📝 记忆口诀

sudo 只能管命令,重定向归 shell 管
要写文件用 tee,-a 追加记心间

📋 快速参考

需求 命令
覆盖写入(root) `echo "内容"
追加写入(root) **`echo "内容"
覆盖写入(非root) echo "内容" > file
追加写入(非root) echo "内容" >> file

一句话总结

记住:在需要 root 权限的目录写文件时,用 sudo tee -a 代替 >>

Attached Files

Loading attached files...
Search Results