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

cat

cat 命令常用案例

命令简介

cat 用于连接文件并输出到标准输出(屏幕)。

使用语法

cat [选项]... [文件]...

特殊说明

选项说明

选项 说明
-A, --show-all 等同于 -vET(显示所有特殊字符)
-b, --number-nonblank 对非空输出行编号(覆盖 -n
-e 等同于 -vE
-E, --show-ends 每行末尾显示 $ 符号
-n, --number 对所有输出行编号
-s, --squeeze-blank 压缩连续的空行(多个空行显示为一个)
-t 等同于 -vT
-T, --show-tabs 将 TAB 显示为 ^I
-u 忽略(无效果)
-v, --show-nonprinting 显示非打印字符(使用 ^M- 标记,LFD 和 TAB 除外)
--help 显示帮助信息
--version 显示版本信息

示例说明

cat f - g     # 先输出 f 的内容,然后接收键盘输入,再输出 g 的内容
cat           # 复制标准输入到标准输出(直接回显输入内容)

常用案例

1. 查看单个文件内容

cat file.txt

2. 查看多个文件内容

cat file1.txt file2.txt

3. 合并多个文件

cat file1.txt file2.txt > merged.txt

4. 创建新文件并写入内容

cat > newfile.txt
# 输入内容,按 Ctrl+D 保存退出

5. 追加内容到文件

cat >> existing.txt
# 输入追加内容,按 Ctrl+D 保存退出

6. 显示所有行号

cat -n file.txt

7. 只对非空行编号

cat -b file.txt

8. 压缩连续空行

cat -s file.txt

将多个连续空行压缩为一行空行。

9. 显示行尾符和 TAB

cat -A file.txt
# 显示效果:$ 表示换行,^I 表示 TAB

10. 显示 TAB 为 ^I

cat -T file.txt

11. 显示行尾 $ 符号

cat -E file.txt

12. 显示所有非打印字符

cat -v file.txt

13. 从键盘输入直接显示(回显)

cat
# 输入任何内容按回车会立即回显,Ctrl+D 退出

14. 实时合并键盘输入和文件

cat file.txt - g.txt
# 输出 file.txt 内容 → 等待键盘输入 → 输出 g.txt 内容

15. 将文件内容通过管道传递给其他命令

cat file.txt | grep "keyword"
cat file.txt | less          # 分页查看
cat file.txt | wc -l         # 统计行数

16. 用 cat 快速创建多个文件

cat > file1.txt << EOF
This is line 1
This is line 2
EOF

17. 查看文件并带行号,压缩空行

cat -s -n file.txt

18. 反转输出(使用 tac 命令)

tac file.txt      # cat 的反向版本,从最后一行开始输出

常用组合技巧

需求 命令
查看文件并分页 `cat file.txt
查看文件并搜索 `cat file.txt
统计文件行数 `cat file.txt
合并所有 txt 文件 cat *.txt > all.txt
复制文件内容到新文件 cat source.txt > dest.txt
清空文件内容 cat /dev/null > file.txt

注意事项

1. cat> 重定向的配合

cat file1.txt > file2.txt   # 覆盖写入
cat file1.txt >> file2.txt  # 追加写入

2. 查看大文件不推荐用 cat

对于大文件(几 GB),直接 cat 会导致屏幕快速滚动,且消耗大量资源。推荐使用:

less largefile.log
more largefile.log
head -n 100 largefile.log   # 查看前100行
tail -n 100 largefile.log   # 查看后100行

3. cat 与管道

# 不要这样(无意义)
cat file.txt | cat

# 应该这样(直接用)
cat file.txt

# 但当需要处理时有用
cat file.txt | sort | uniq

4. 用 cat 确认文件编码

cat -A file.txt   # 可以显示不可见的特殊字符

实际工作场景案例

查看配置文件

cat /etc/hosts
cat /etc/nginx/nginx.conf

合并日志文件

cat access.log.1 access.log.2 > combined.log

创建简单的脚本或配置文件

cat > myscript.sh << 'EOF'
#!/bin/
echo "Hello World"
EOF
chmod +x myscript.sh

将多个文件内容拼接到邮件正文

cat header.txt body.txt footer.txt | mail -s "Report" user@example.com

Attached Files

Loading attached files...
Search Results