# 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>
