# Linux

<details>

<summary>Reboot 重新啟動</summary>

```sh
$ sudo reboot
$ last -x reboot
```

</details>

<details>

<summary>Apt</summary>

```sh
sudo apt update
apt list --upgradable
```

</details>

<details>

<summary>Python</summary>

```sh
sudo apt install python3-pip
pip3 --version
pip3 install requests
pip3 install bs4
```

</details>

<details>

<summary>Crontab 定時任務</summary>

依序是分鐘(0-59), 小時(0-23), 日期(1-31), 月份(1-12), 星期(0-6), command&#x20;

* 星期參數為0代表星期日

```sh
$ crontab -l: 列出該使用者擁有的 crontab 指令
$ crontab -e: 編輯該使用者的 crontab 指令
$ crontab -r: 將使用者的 crontab 全部清除！（ 小心使用 ）
```

```sh
0 */8 * * * /usr/bin/python3 /home/user/FamilyMart.py
30 */8 * * * /usr/bin/python3 /home/user/OK_Mart.py
0 18,22 * * 1-5 /usr/bin/python3 /home/user/Shopee_Get_Logistics.py
```

</details>

<details>

<summary>Traceroute 追蹤路由</summary>

```sh
apt-get install traceroute
traceroute www.ggl.tw
```

</details>

<details>

<summary>Timedatectl 時區設定</summary>

```shell
sudo timedatectl set-timezone Asia/Taipei
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.ggl.tw/document/linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
