Files
script/bash/README.md
牡蛎 da5d99372a docs(bash): 更新 README 中的 curl 命令示例
- 在所有 curl 命令中添加 -L 选项以支持重定向
- 添加 -f 选项以在发生错误时返回非零退出代码
- 保留 -sS 选项以保持静默模式并显示错误信息
2025-07-02 19:21:16 +08:00

47 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Bash
## Linux
### 初始化脚本
```bash
curl -LsSf https://i.sugarscat.cn/me/script/-/raw/main/bash/init.sh | bash
```
进行的操作有:
1. 更换软件源为 `清华大学源`
2. 更换DNS为 `114.114.114.114``223.5.5.5`
3. 设置时区 `Asia/Shanghai` 和时间同步
```bash
curl -LsSf https://i.sugarscat.cn/me/script/-/raw/main/bash/init-ali.sh | bash
```
进行的操作有:
1. 更换软件源为 `阿里云源`
2. 更换DNS为 `114.114.114.114``223.5.5.5`
3. 设置时区 `Asia/Shanghai` 和时间同步
### 系统清理脚本
> [!CAUTION]
>
> **删库警告**
>
> 该脚本不适合 NAS 系统使用,部分 NAS 的磁盘挂载点在 `/tmp` 目录下,该脚本会清理掉 NAS 的数据。
```bash
curl -LsSf https://i.sugarscat.cn/me/script/-/raw/main/bash/clean.sh | bash
```
进行的操作有:
1. 显示系统信息
2. 清理旧的内核包和残留的配置文件
3. 清理 /tmp 目录下的临时文件
4. 清理 APT 缓存目录 /var/cache/apt/archives
5. 清理用户缓存目录 ~/.cache
6. 清理 systemd 日志 /var/log/journal