<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>博客</title>
    <link>https://xiou.de</link>
    <description>一个偏向纯文本与阅读的个人站点。</description>
    <language>zh-CN</language>
    <managingEditor>PMJFFF</managingEditor>
    <lastBuildDate>Mon, 10 Nov 2025 00:00:00 GMT</lastBuildDate>
    <atom:link href="https://xiou.de/rss.xml" rel="self" type="application/rss+xml" />
        <item>
      <title>Tar 打包备份</title>
      <link>https://xiou.de/tar-backup</link>
      <guid isPermaLink="true">https://xiou.de/tar-backup</guid>
      <pubDate>Mon, 10 Nov 2025 00:00:00 GMT</pubDate>
      <description>用于打包目录与查看压缩内容的常用 tar 命令。</description>
      <category>backup</category><category>linux</category>
      <content:encoded><![CDATA[<p>一个简单的日期归档示例：</p>
<pre><code>
tar -czf backup-$(date +%F).tar.gz /opt/project
</code></pre>
<p>查看压缩包内容：</p>
<pre><code>
tar -tzf backup-2025-11-10.tar.gz
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Nc 端口测试</title>
      <link>https://xiou.de/nc-port-test</link>
      <guid isPermaLink="true">https://xiou.de/nc-port-test</guid>
      <pubDate>Wed, 05 Nov 2025 00:00:00 GMT</pubDate>
      <description>用于测试 TCP 端口连通性的常用 netcat 命令。</description>
      <category>network</category><category>linux</category>
      <content:encoded><![CDATA[<p>测试远端端口是否可达：</p>
<pre><code>
nc -zv 127.0.0.1 80
nc -zv example.com 443
</code></pre>
<p>监听本地端口：</p>
<pre><code>
nc -l 9000
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Systemd 服务与日志排查</title>
      <link>https://xiou.de/systemd-service-logs</link>
      <guid isPermaLink="true">https://xiou.de/systemd-service-logs</guid>
      <pubDate>Sun, 02 Nov 2025 00:00:00 GMT</pubDate>
      <description>用于查看服务状态、重启服务与追踪日志的常用 systemd 命令。</description>
      <category>linux</category><category>text</category>
      <content:encoded><![CDATA[<p>`systemctl` 和 `journalctl` 通常需要配合使用：前者查看和管理服务状态，后者查看服务日志。</p>
<h2>查看某个服务状态</h2>
<pre><code>
systemctl status nginx
systemctl status docker
</code></pre>
<h2>重启服务与重新加载配置</h2>
<pre><code>
systemctl restart nginx
systemctl daemon-reload
</code></pre>
<h2>列出系统服务</h2>
<pre><code>
systemctl list-units --type=service
</code></pre>
<h2>查看某个服务日志</h2>
<pre><code>
journalctl -u nginx
journalctl -u docker -f
</code></pre>
<h2>查看最近启动日志</h2>
<pre><code>
journalctl -b
journalctl -b -1
</code></pre>
<h2>按时间筛选日志</h2>
<pre><code>
journalctl --since &quot;2025-10-01 00:00:00&quot;
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Wget 下载文件</title>
      <link>https://xiou.de/wget-download</link>
      <guid isPermaLink="true">https://xiou.de/wget-download</guid>
      <pubDate>Thu, 30 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于下载文件与断点续传的常用 wget 命令。</description>
      <category>network</category><category>linux</category>
      <content:encoded><![CDATA[<p>几条常用 wget 写法：</p>
<pre><code>
wget https://example.com/file.iso
wget -c https://example.com/file.iso
wget -O custom-name.tar.gz https://example.com/file.tar.gz
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Zip 与 Unzip 命令</title>
      <link>https://xiou.de/zip-unzip</link>
      <guid isPermaLink="true">https://xiou.de/zip-unzip</guid>
      <pubDate>Tue, 28 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于压缩目录与解压文件的常用 zip / unzip 命令。</description>
      <category>backup</category><category>linux</category>
      <content:encoded><![CDATA[<p>创建 zip 压缩包：</p>
<pre><code>
zip -r backup.zip /data/project
</code></pre>
<p>解压文件：</p>
<pre><code>
unzip backup.zip -d /tmp/output
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Grep 日志筛选</title>
      <link>https://xiou.de/grep-log-filter</link>
      <guid isPermaLink="true">https://xiou.de/grep-log-filter</guid>
      <pubDate>Sun, 26 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于筛选错误日志与关键字的常用 grep 示例。</description>
      <category>text</category><category>linux</category>
      <content:encoded><![CDATA[<p>排查日志时最常见的是 `grep`。</p>
<pre><code>
grep -n &quot;error&quot; app.log
grep -i &quot;timeout&quot; app.log
grep -R &quot;listen 80&quot; /etc/nginx
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Find 查找文件</title>
      <link>https://xiou.de/find-files</link>
      <guid isPermaLink="true">https://xiou.de/find-files</guid>
      <pubDate>Fri, 24 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于按名称、时间和类型查找文件的常用 find 示例。</description>
      <category>linux</category><category>text</category>
      <content:encoded><![CDATA[<p>常见的 `find` 用法如下。</p>
<pre><code>
find /var/log -name &apos;*.log&apos;
find . -type f -mtime -1
find /data -type d -name backup
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Awk 列统计</title>
      <link>https://xiou.de/awk-column-sum</link>
      <guid isPermaLink="true">https://xiou.de/awk-column-sum</guid>
      <pubDate>Wed, 22 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于列求和与条件输出的常用 awk 示例。</description>
      <category>text</category><category>linux</category>
      <content:encoded><![CDATA[<p>统计某一列时，`awk` 很方便。</p>
<pre><code>
awk &apos;{sum += $2} END {print sum}&apos; data.txt
</code></pre>
<p>只打印满足条件的行：</p>
<pre><code>
awk &apos;$2 &gt; 100 {print $1, $2}&apos; data.txt
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Sed 文本替换</title>
      <link>https://xiou.de/sed-replace</link>
      <guid isPermaLink="true">https://xiou.de/sed-replace</guid>
      <pubDate>Mon, 20 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于批量替换文本内容的常用 sed 示例。</description>
      <category>text</category><category>linux</category>
      <content:encoded><![CDATA[<p>下面是一条常见的替换命令。</p>
<pre><code>
sed -i &apos;s/old/new/g&apos; file.txt
</code></pre>
<p>如果只想预览而不写回：</p>
<pre><code>
sed &apos;s/old/new/g&apos; file.txt
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Tmux 基础命令</title>
      <link>https://xiou.de/tmux-basics</link>
      <guid isPermaLink="true">https://xiou.de/tmux-basics</guid>
      <pubDate>Sat, 18 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于会话管理、分屏与窗口切换的常用 tmux 命令。</description>
      <category>terminal</category><category>linux</category>
      <content:encoded><![CDATA[<p>记录几条最常用的 tmux 命令。</p>
<h2>新建与进入会话</h2>
<pre><code>
tmux new -s work
tmux attach -t work
</code></pre>
<h2>分屏</h2>
<pre><code>
Ctrl+b %
Ctrl+b &quot;
</code></pre>
<h2>常见窗口操作</h2>
<pre><code>
Ctrl+b c
Ctrl+b n
Ctrl+b p
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Fail2ban 安装配置</title>
      <link>https://xiou.de/fail2ban-install</link>
      <guid isPermaLink="true">https://xiou.de/fail2ban-install</guid>
      <pubDate>Fri, 17 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于安装、启动与基础配置 Fail2ban 的常用命令与示例。</description>
      <category>security</category><category>linux</category>
      <content:encoded><![CDATA[<h2>环境</h2>
<ul>
<li>系统：Debian 12 x86_64</li>
<li>Fail2ban 版本：0.11.2</li>
</ul>
<h2>1. 安装软件</h2>
<pre><code>
apt update
apt install fail2ban
</code></pre>
<h2>2. 启动 Fail2ban</h2>
<p>启动服务：</p>
<pre><code>
systemctl start fail2ban
</code></pre>
<p>设置开机自启：</p>
<pre><code>
systemctl enable fail2ban
</code></pre>
<p>查看运行状态：</p>
<pre><code>
systemctl status fail2ban
</code></pre>
<p>如果输出中出现 `active (running)`，通常说明服务启动成功。</p>
<h2>3. 配置 Fail2ban</h2>
<p>进入 `/etc/fail2ban` 目录，编辑 `jail.local` 文件，添加需要防止爆破的服务规则。</p>
<p>下面是一个常见的 SSH 配置示例：</p>
<pre><code>
[sshd]
enabled = true
filter = sshd
port = 22
maxretry = 5
findtime = 43200
bantime = 604800
action = %(action_mwl)s
logpath = /var/log/auth.log
</code></pre>
<p>参数说明：</p>
<ul>
<li>`enabled = true`：启用该规则</li>
<li>`filter = sshd`：使用 `sshd` 过滤器</li>
<li>`port = 22`：监控 22 端口</li>
<li>`maxretry = 5`：在指定时间内最多允许失败 5 次</li>
<li>`findtime = 43200`：统计时间范围为 12 小时</li>
<li>`bantime = 604800`：封禁时间为 7 天</li>
<li>`action = %(action_mwl)s`：发送通知邮件并附带日志与 whois 信息</li>
<li>`logpath = /var/log/auth.log`：指定日志路径</li>
</ul>
<p>保存后，重启 Fail2ban：</p>
<pre><code>
systemctl restart fail2ban
</code></pre>
<h2>4. 常用命令</h2>
<p>查看服务状态：</p>
<pre><code>
fail2ban-client status
</code></pre>
<p>查看 `sshd` 规则状态：</p>
<pre><code>
fail2ban-client status sshd
</code></pre>
<p>解封 IP：</p>
<pre><code>
fail2ban-client set sshd unbanip 5.5.5.5
</code></pre>
<p>更多命令可参考官方文档：</p>
<p>[Commands - Fail2ban](https://www.fail2ban.org/wiki/index.php/Commands)</p>]]></content:encoded>
    </item>     <item>
      <title>Python 临时 HTTP 服务</title>
      <link>https://xiou.de/python-temp-http-server</link>
      <guid isPermaLink="true">https://xiou.de/python-temp-http-server</guid>
      <pubDate>Thu, 16 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于快速共享目录的常用 Python 临时 HTTP 服务命令。</description>
      <category>python</category><category>web</category>
      <content:encoded><![CDATA[<p>这篇文章记录一个最简单的目录共享方法：使用 Python 在本地快速启动临时 HTTP 服务，方便局域网内下载文件。</p>
<h2>1. 进入要共享的目录</h2>
<pre><code>
cd /opt
</code></pre>
<h2>2. 启动临时 HTTP 服务</h2>
<pre><code>
python3 -m http.server 8000
</code></pre>
<p>输出类似下面内容时，说明服务已经启动成功：</p>
<pre><code>
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
</code></pre>
<h2>3. 在其他设备中访问</h2>
<p>在浏览器中打开：</p>
<pre><code>
http://&lt;你的服务器IP&gt;:8000
</code></pre>
<p>例如：</p>
<pre><code>
http://192.168.1.10:8000
</code></pre>
<p>此时就可以看到 `/opt/` 目录下的文件列表，点击即可下载。</p>
<p>如果使用 IDM，也可以直接复制这个 URL 并通过“添加 URL”的方式下载。</p>]]></content:encoded>
    </item>     <item>
      <title>端口排查命令</title>
      <link>https://xiou.de/port-debug</link>
      <guid isPermaLink="true">https://xiou.de/port-debug</guid>
      <pubDate>Wed, 15 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于查看端口占用与定位进程的常用排查命令。</description>
      <category>network</category><category>linux</category>
      <content:encoded><![CDATA[<p>如果某个端口被占用，可以先这样查。</p>
<h2>使用 ss</h2>
<pre><code>
ss -lntp
ss -lntp | grep 8080
</code></pre>
<h2>使用 lsof</h2>
<pre><code>
lsof -i :8080
</code></pre>
<h2>结束进程</h2>
<pre><code>
kill -9 &lt;pid&gt;
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Docker Compose 重启</title>
      <link>https://xiou.de/docker-compose-restart</link>
      <guid isPermaLink="true">https://xiou.de/docker-compose-restart</guid>
      <pubDate>Sun, 12 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于重建、重启与查看日志的常用 Docker Compose 命令。</description>
      <category>docker</category><category>deployment</category>
      <content:encoded><![CDATA[<p>记录几条 Docker Compose 常用命令。</p>
<h2>启动服务</h2>
<pre><code>
docker compose up -d
</code></pre>
<h2>重新构建并启动</h2>
<pre><code>
docker compose up -d --build
</code></pre>
<h2>查看日志</h2>
<pre><code>
docker compose logs -f
</code></pre>
<h2>停止并删除容器</h2>
<pre><code>
docker compose down
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Curl HTTP 调试</title>
      <link>https://xiou.de/curl-http-debug</link>
      <guid isPermaLink="true">https://xiou.de/curl-http-debug</guid>
      <pubDate>Wed, 08 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于请求调试、响应头查看与 POST 测试的常用 curl 命令。</description>
      <category>network</category><category>web</category>
      <content:encoded><![CDATA[<p>几条常见 curl 写法如下。</p>
<h2>查看响应头</h2>
<pre><code>
curl -I https://example.com
</code></pre>
<h2>打印详细过程</h2>
<pre><code>
curl -v https://example.com
</code></pre>
<h2>发送 JSON POST</h2>
<pre><code>
curl -X POST https://example.com/api \
  -H &quot;Content-Type: application/json&quot; \
  -d &apos;{&quot;name&quot;:&quot;test&quot;}&apos;
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Crontab 定时任务</title>
      <link>https://xiou.de/crontab-jobs</link>
      <guid isPermaLink="true">https://xiou.de/crontab-jobs</guid>
      <pubDate>Wed, 01 Oct 2025 00:00:00 GMT</pubDate>
      <description>用于定时备份与日志清理的常用 crontab 示例。</description>
      <category>automation</category><category>linux</category>
      <content:encoded><![CDATA[<p>这里记录两条常见的 crontab 写法。</p>
<h2>编辑任务</h2>
<pre><code>
crontab -e
</code></pre>
<h2>每天凌晨 2 点备份</h2>
<pre><code>
0 2 * * * /opt/scripts/backup.sh
</code></pre>
<h2>每周清理日志</h2>
<pre><code>
0 3 * * 0 find /var/log/myapp -type f -mtime +7 -delete
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Ufw 防火墙规则</title>
      <link>https://xiou.de/ufw-rules</link>
      <guid isPermaLink="true">https://xiou.de/ufw-rules</guid>
      <pubDate>Sun, 28 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于启用防火墙并放行常见端口的常用 UFW 命令。</description>
      <category>security</category><category>linux</category>
      <content:encoded><![CDATA[<p>一组最常用的 UFW 规则如下。</p>
<pre><code>
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
ufw status verbose
</code></pre>
<p>如果只想临时关闭：</p>
<pre><code>
ufw disable
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>SSH 免密登录</title>
      <link>https://xiou.de/ssh-key-login</link>
      <guid isPermaLink="true">https://xiou.de/ssh-key-login</guid>
      <pubDate>Thu, 25 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于生成密钥并开启 SSH 免密登录的常用流程。</description>
      <category>security</category><category>linux</category>
      <content:encoded><![CDATA[<p>记录 SSH 免密登录的常见步骤。</p>
<h2>生成密钥</h2>
<pre><code>
ssh-keygen -t ed25519 -C &quot;me@example.com&quot;
</code></pre>
<h2>拷贝公钥</h2>
<pre><code>
ssh-copy-id user@host
</code></pre>
<h2>测试登录</h2>
<pre><code>
ssh user@host
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Nginx 反向代理</title>
      <link>https://xiou.de/nginx-reverse-proxy</link>
      <guid isPermaLink="true">https://xiou.de/nginx-reverse-proxy</guid>
      <pubDate>Mon, 22 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于搭建反向代理的最小可用 Nginx 配置示例。</description>
      <category>web</category><category>network</category>
      <content:encoded><![CDATA[<p>下面是一份很常见的反向代理配置。</p>
<pre><code>
server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
</code></pre>
<p>改完后记得测试并重载：</p>
<pre><code>
nginx -t
systemctl reload nginx
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Rsync 备份目录</title>
      <link>https://xiou.de/rsync-backup</link>
      <guid isPermaLink="true">https://xiou.de/rsync-backup</guid>
      <pubDate>Thu, 18 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于本地与远程目录同步的常用 rsync 示例。</description>
      <category>backup</category><category>linux</category>
      <content:encoded><![CDATA[<p>这篇文章记录一个常见的目录备份写法。</p>
<h2>本地同步</h2>
<pre><code>
rsync -avh --delete /data/source/ /data/backup/
</code></pre>
<h2>远程同步</h2>
<pre><code>
rsync -avh /data/source/ user@host:/data/backup/
</code></pre>
<h2>常用参数</h2>
<ul>
<li>`-a`：归档模式</li>
<li>`-v`：显示过程</li>
<li>`-h`：更友好的大小显示</li>
<li>`--delete`：删除目标端多余文件</li>
</ul>]]></content:encoded>
    </item>     <item>
      <title>Vim 基础使用</title>
      <link>https://xiou.de/vim-basics</link>
      <guid isPermaLink="true">https://xiou.de/vim-basics</guid>
      <pubDate>Sun, 14 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于移动、编辑、保存与退出的常用 Vim 操作速记。</description>
      <category>editor</category><category>linux</category>
      <content:encoded><![CDATA[<p>记录几条最常用的 Vim 基础操作。</p>
<h2>进入插入模式</h2>
<pre><code>
i
a
o
</code></pre>
<h2>保存与退出</h2>
<pre><code>
:w
:q
:wq
:q!
</code></pre>
<h2>常见移动</h2>
<pre><code>
h j k l
0
$
gg
G
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Git 命令速查</title>
      <link>https://xiou.de/git-commands</link>
      <guid isPermaLink="true">https://xiou.de/git-commands</guid>
      <pubDate>Fri, 12 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于提交、回退、分支与同步的常用 Git 命令速查。</description>
      <category>git</category><category>text</category>
      <content:encoded><![CDATA[<p>整理一些日常最常用的 Git 命令，适合快速查阅。</p>
<h2>查看状态</h2>
<pre><code>
git status
git log --oneline --decorate -n 10
</code></pre>
<h2>提交修改</h2>
<pre><code>
git add .
git commit -m &quot;update&quot;
</code></pre>
<h2>同步远程</h2>
<pre><code>
git pull --rebase origin main
git push origin main
</code></pre>
<h2>分支操作</h2>
<pre><code>
git branch
git switch -c feature/test
git switch main
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Linux 命令速查</title>
      <link>https://xiou.de/linux-commands</link>
      <guid isPermaLink="true">https://xiou.de/linux-commands</guid>
      <pubDate>Wed, 10 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于文件、进程、网络、权限与压缩操作的常用 Linux 命令速查。</description>
      <category>linux</category><category>text</category>
      <content:encoded><![CDATA[<h2>引言</h2>
<p>Linux 是一款强大而灵活的操作系统，命令行界面（CLI）是系统管理和开发的核心工具。无论是文件操作、进程管理还是网络配置，掌握常用命令都是每一位 Linux 用户的基础能力。本文整理了一些常见且实用的 Linux 命令，方便快速查阅。</p>
<h2>文件与目录操作</h2>
<h3>1. `ls`：列出目录内容</h3>
<pre><code>
ls          # 列出当前目录的文件和目录
ls -l       # 以详细列表形式显示
ls -a       # 显示包括隐藏文件在内的所有文件
</code></pre>
<h3>2. `cd`：切换目录</h3>
<pre><code>
cd /home    # 切换到 /home 目录
cd ..       # 返回上一级目录
cd ~        # 切换到当前用户家目录
</code></pre>
<h3>3. `pwd`：显示当前路径</h3>
<pre><code>
pwd         # 输出当前所在目录的绝对路径
</code></pre>
<h3>4. `cp`：复制文件或目录</h3>
<pre><code>
cp file1 file2      # 复制文件
cp -r dir1 dir2     # 递归复制目录
</code></pre>
<h3>5. `mv`：移动或重命名文件</h3>
<pre><code>
mv old.txt new.txt  # 重命名文件
mv file1 /tmp       # 移动文件到 /tmp 目录
</code></pre>
<h3>6. `rm`：删除文件或目录</h3>
<pre><code>
rm file.txt         # 删除文件
rm -r directory     # 递归删除目录（谨慎使用）
</code></pre>
<h3>7. `mkdir`：创建目录</h3>
<pre><code>
mkdir new_folder    # 创建新目录
mkdir -p a/b/c      # 创建多级目录
</code></pre>
<h2>文件查看与编辑</h2>
<h3>8. `cat`：查看文件内容</h3>
<pre><code>
cat file.txt
</code></pre>
<h3>9. `less` / `more`：分页查看文件</h3>
<pre><code>
less long_file.log
more long_file.log
</code></pre>
<h3>10. `head` / `tail`：查看头部或尾部内容</h3>
<pre><code>
head -n 10 file.log
tail -f file.log
</code></pre>
<h3>11. `nano` / `vim`：文本编辑器</h3>
<pre><code>
nano file.txt
vim file.txt
</code></pre>
<h2>系统与进程管理</h2>
<h3>12. `ps`：查看进程状态</h3>
<pre><code>
ps aux
</code></pre>
<h3>13. `top` / `htop`：查看系统资源</h3>
<pre><code>
top
htop
</code></pre>
<h3>14. `kill`：终止进程</h3>
<pre><code>
kill 1234
kill -9 1234
</code></pre>
<h3>15. `systemctl`：管理系统服务</h3>
<pre><code>
systemctl start nginx
systemctl status nginx
</code></pre>
<h2>网络相关命令</h2>
<h3>16. `curl` / `wget`：下载文件或访问网页</h3>
<pre><code>
curl -O http://example.com/file.zip
wget http://example.com/file.zip
</code></pre>
<h3>17. `ssh`：远程登录</h3>
<pre><code>
ssh user@hostname
</code></pre>
<h3>18. `scp`：安全复制文件</h3>
<pre><code>
scp file.txt user@host:/path
</code></pre>
<h2>权限管理</h2>
<h3>19. `chmod`：修改文件权限</h3>
<pre><code>
chmod 755 script.sh
chmod +x script.sh
</code></pre>
<h3>20. `chown`：修改文件所有者</h3>
<pre><code>
chown user:group file
</code></pre>
<h2>压缩与解压</h2>
<h3>21. `tar`：打包与解包文件</h3>
<pre><code>
tar -czvf archive.tar.gz /path
tar -xzvf archive.tar.gz
</code></pre>
<h3>22. `gzip` / `gunzip`：压缩与解压文件</h3>
<pre><code>
gzip file.txt
gunzip file.txt.gz
</code></pre>
<h2>总结</h2>
<p>以上命令覆盖了 Linux 日常使用中的常见操作。熟悉这些命令之后，可以明显提升系统管理与排障效率。</p>
<p>如果需要查看某个命令的完整说明，可以使用：</p>
<pre><code>
man ls
</code></pre>]]></content:encoded>
    </item>     <item>
      <title>Docker 命令速查</title>
      <link>https://xiou.de/docker-commands</link>
      <guid isPermaLink="true">https://xiou.de/docker-commands</guid>
      <pubDate>Wed, 10 Sep 2025 00:00:00 GMT</pubDate>
      <description>用于镜像、容器、调试与清理的常用 Docker 命令速查。</description>
      <category>docker</category><category>linux</category>
      <content:encoded><![CDATA[<h2>引言</h2>
<p>Docker 通过容器化技术极大地简化了应用的开发、部署和运维流程。本文整理了从镜像管理、容器生命周期管理到调试与清理的一组高频命令，便于日常查阅。</p>
<h2>镜像管理</h2>
<h3>1. `docker search`：搜索镜像</h3>
<pre><code>
docker search nginx
docker search --filter is-official=true ubuntu
</code></pre>
<h3>2. `docker pull`：拉取镜像</h3>
<pre><code>
docker pull ubuntu:20.04
docker pull nginx
</code></pre>
<h3>3. `docker images`：列出本地镜像</h3>
<pre><code>
docker images
docker images -q
</code></pre>
<h3>4. `docker rmi`：删除本地镜像</h3>
<pre><code>
docker rmi nginx:latest
docker rmi $(docker images -q)
</code></pre>
<h3>5. `docker build`：构建镜像</h3>
<pre><code>
docker build -t my-app:1.0 .
</code></pre>
<h2>容器生命周期管理</h2>
<h3>6. `docker run`：创建并启动容器</h3>
<pre><code>
docker run -d --name my-nginx -p 8080:80 nginx

docker run -it --rm ubuntu /bin/bash
</code></pre>
<h3>7. `docker ps`：列出容器</h3>
<pre><code>
docker ps
docker ps -a
docker ps -q
</code></pre>
<h3>8. `docker stop`：停止容器</h3>
<pre><code>
docker stop my-nginx
docker stop $(docker ps -q)
</code></pre>
<h3>9. `docker start`：启动已停止容器</h3>
<pre><code>
docker start my-nginx
</code></pre>
<h3>10. `docker restart`：重启容器</h3>
<pre><code>
docker restart my-nginx
</code></pre>
<h3>11. `docker rm`：删除容器</h3>
<pre><code>
docker rm my-nginx
docker rm -f my-nginx
docker rm $(docker ps -a -q)
</code></pre>
<h2>容器交互与调试</h2>
<h3>12. `docker logs`：查看容器日志</h3>
<pre><code>
docker logs my-nginx
docker logs -f my-nginx
docker logs --tail 100 my-nginx
</code></pre>
<h3>13. `docker exec`：在容器内执行命令</h3>
<pre><code>
docker exec -it my-nginx /bin/bash
docker exec my-nginx ls /usr/share/nginx/html
</code></pre>
<h3>14. `docker inspect`：查看容器详细信息</h3>
<pre><code>
docker inspect my-nginx
docker inspect --format=&apos;{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}&apos; my-nginx
</code></pre>
<h2>资源与系统管理</h2>
<h3>15. `docker system df`：查看磁盘使用情况</h3>
<pre><code>
docker system df
</code></pre>
<h3>16. `docker system prune`：清理未使用资源</h3>
<pre><code>
docker system prune
docker system prune -a
</code></pre>
<h2>总结</h2>
<p>本文覆盖了 Docker 的一组高频命令，适合在日常开发和运维中作为速查手册使用。</p>
<p>如果需要查看完整帮助，可以使用：</p>
<pre><code>
docker --help
docker &lt;COMMAND&gt; --help
</code></pre>]]></content:encoded>
    </item>
  </channel>
</rss>