Skip to content

Commit d239aad

Browse files
committed
More code block language (console) update
1 parent d25f43e commit d239aad

16 files changed

Lines changed: 120 additions & 120 deletions

File tree

docs/Appendix/distribution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Ubuntu 基于 Debian,并且相比 Debian 而言更加新手友好。而 Debian
1818

1919
简单使用:
2020

21-
```shell
21+
```console
2222
$ sudo dnf install audacity # 安装 audacity
2323
$ sudo dnf remove firefox # 卸载 firefox
2424
$ dnf search thunderbird # 搜索 thunderbird
@@ -51,7 +51,7 @@ SELinux 添加了额外的「强制访问控制」安全措施:系统中所有
5151

5252
Arch 使用的默认软件包管理器是 `pacman`。以下是一些常用的命令。
5353

54-
```shell
54+
```console
5555
$ sudo pacman -Syu # 更新系统所有软件包
5656
$ sudo pacman -S firefox # 安装 Firefox
5757
$ sudo pacman -Rs chromium # 卸载 Chromium 和它的所有依赖
@@ -86,7 +86,7 @@ openSUSE 使用 RPM 作为其软件包格式,但是与 Fedora、CentOS 等不
8686

8787
以下是一些常用的命令:
8888

89-
```shell
89+
```console
9090
$ sudo zypper update # 更新系统所有软件包
9191
$ sudo zypper install firefox # 安装 Firefox
9292
$ sudo zypper remove chromium # 卸载 Chromium 和它的所有依赖
@@ -118,7 +118,7 @@ Gentoo 的软件包管理器是 Portage。其对应最常用的 CLI 工具是 `e
118118

119119
以下是一些常用的命令:
120120

121-
```shell
121+
```console
122122
$ sudo emerge --sync # 更新软件包索引
123123
$ sudo emerge --update --ask @world # 更新已安装的程序(不包含依赖)
124124
$ sudo emerge -a firefox # 安装 Firefox

docs/Ch01/supplement.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SELinux 有 3 种工作模式:
5353

5454
使用 `sestatus` 命令查看 SELinux 状态:
5555

56-
```
56+
```console
5757
$ sestatus
5858
SELinux status: enabled
5959
SELinuxfs mount: /sys/fs/selinux
@@ -220,13 +220,13 @@ $ sudo resize2fs /dev/sda2
220220

221221
在服务器上首先安装 `openssh-server` 软件包,它提供了 SSH 服务器的功能。
222222

223-
```
223+
```console
224224
$ sudo apt install openssh-server
225225
```
226226

227227
启动并检查 SSH 服务状态:
228228

229-
```
229+
```console
230230
$ sudo systemctl start ssh
231231
$ sudo systemctl status ssh
232232
● ssh.service - OpenBSD Secure Shell server
@@ -248,7 +248,7 @@ $ sudo systemctl status ssh
248248

249249
我们可以使用 `ssh` 命令直接连接到本地(localhost)的 SSH 服务器。其中 `@` 符号前的是登录的用户名,后面的是服务器的域名或 IP 地址。
250250

251-
```
251+
```console
252252
$ ssh ustc@localhost
253253
The authenticity of host 'localhost (127.0.0.1)' can't be established.
254254
ECDSA key fingerprint is SHA256:czt1KYx+RIkFTpSPQOLq+GqLbLRLZcD1Ffkq4Z3ZR2U.
@@ -321,7 +321,7 @@ ustc@ustclug-linux101:~$
321321

322322
首先在自己的机器上使用 `ssh-keygen` 生成密钥:
323323

324-
```
324+
```console
325325
$ ssh-keygen
326326
Generating public/private rsa key pair.
327327
Enter file in which to save the key (/home/ustc/.ssh/id_rsa):
@@ -349,7 +349,7 @@ ustc@ustclug-linux101:~$
349349

350350
在本地使用 `ssh-copy-id` 命令将公钥拷贝到服务器上:
351351

352-
```
352+
```console
353353
$ ssh-copy-id ustc@localhost
354354
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
355355
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
@@ -377,7 +377,7 @@ ustc@ustclug-linux101:~$
377377

378378
然后让 SSH 服务器重新加载配置:
379379

380-
```
380+
```console
381381
$ sudo systemctl reload ssh
382382
```
383383

@@ -500,7 +500,7 @@ Featured Server Snaps 一样可以选择不安装,可以之后自行配置。
500500

501501
如果你需要带图形界面的虚拟机,只需要安装 `ubuntu-desktop` 即可。
502502

503-
```bash
503+
```console
504504
$ sudo apt-get install ubuntu-desktop
505505
```
506506

docs/Ch02/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Xfce4-session 是 Xfce 的会话管理器。它的任务是保存桌面的状态
295295

296296
然而使用命令行,我们只需要执行一条指令。
297297

298-
```shell
298+
```console
299299
$ mv /path/to/source/file.txt /path/to/dest/
300300
```
301301

@@ -384,7 +384,7 @@ rm main.out
384384

385385
之后我们直接输入
386386

387-
```shell
387+
```console
388388
$ sh run.sh
389389
```
390390

@@ -454,7 +454,7 @@ $ sh run.sh
454454

455455
#### 示例 1 {#shell-commands-example-1}
456456

457-
```shell
457+
```console
458458
$ pwd
459459
```
460460

@@ -466,7 +466,7 @@ $ pwd
466466

467467
#### 示例 2 {#shell-commands-example-2}
468468

469-
```shell
469+
```console
470470
$ ls
471471
```
472472

@@ -478,7 +478,7 @@ Desktop Documents Music Pictures Public Templates Videos
478478

479479
#### 示例 3 {#shell-commands-example-3}
480480

481-
```shell
481+
```console
482482
$ cd Desktop # 这里的 Desktop 是相对路径,指的就是当前目录下的 Desktop 文件夹
483483
$ ls
484484
```
@@ -517,7 +517,7 @@ WordPress 是一个以 PHP 和 MySQL 为平台的自由开源的博客软件和
517517

518518
下载脚本要使用 `curl` 命令,我们要先安装 curl。
519519

520-
```shell
520+
```console
521521
$ sudo apt install curl
522522
```
523523

@@ -536,7 +536,7 @@ $ sudo apt install curl
536536

537537
打开终端并运行:
538538

539-
```shell
539+
```console
540540
$ curl -fsSL https://101.lug.ustc.edu.cn/Ch02/wordpress.sh > wordpress.sh
541541
$ # 可以阅读 wordpress.sh 了解其运行的命令,检查代码无误后执行:
542542
$ sudo bash wordpress.sh
@@ -571,13 +571,13 @@ Jekyll 是一个将纯文本转化为静态博客和网站的工具。
571571

572572
我们只需要通过命令行安装它。
573573

574-
```shell
574+
```console
575575
$ sudo apt install jekyll
576576
```
577577

578578
再输入几行命令用于创建网站:
579579

580-
```shell
580+
```console
581581
$ jekyll new my-awesome-site
582582
$ cd my-awesome-site
583583
$ jekyll serve

docs/Ch02/supplement.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ icon: material/puzzle
1616

1717
安装 `ubuntu-gnome-desktop` 软件:
1818

19-
```shell
19+
```console
2020
$ sudo apt install ubuntu-gnome-desktop
2121
```
2222

@@ -28,7 +28,7 @@ $ sudo apt install ubuntu-gnome-desktop
2828

2929
安装完成后输入:
3030

31-
```shell
31+
```console
3232
$ sudo reboot
3333
```
3434

@@ -56,7 +56,7 @@ $ sudo reboot
5656
在 GNOME 桌面下用户可以轻松更换主题。
5757
首先安装 `gnome-tweaks` 软件:
5858

59-
```shell
59+
```console
6060
$ sudo apt install gnome-tweaks
6161
```
6262

@@ -72,7 +72,7 @@ $ sudo apt install gnome-tweaks
7272

7373
解压后放到 `~/.themes` 文件夹,若不存在该文件夹则创建一个。
7474

75-
```shell
75+
```console
7676
$ mkdir ~/.themes
7777
```
7878

@@ -84,7 +84,7 @@ $ mkdir ~/.themes
8484

8585
输入:
8686

87-
```shell
87+
```console
8888
$ gnome-tweaks
8989
```
9090

@@ -104,7 +104,7 @@ GNOME 支持很多扩展,并且有一个专门用于扩展的网站。https://
104104

105105
要使用 GNOME 扩展,我们要先安装 `gnome-shell-extensions`
106106

107-
```shell
107+
```console
108108
$ sudo apt install gnome-shell-extensions
109109
```
110110

@@ -116,7 +116,7 @@ Caffeine: 允许用户停用系统屏幕保护和自动休眠。
116116

117117
先来查看我们正在使用的 GNOME 版本:
118118

119-
```shell
119+
```console
120120
$ gnome-shell --version
121121
```
122122

@@ -136,7 +136,7 @@ $ gnome-shell --version
136136

137137
打开 `gnome-tweaks`
138138

139-
```shell
139+
```console
140140
$ gnome-tweaks
141141
```
142142

@@ -218,7 +218,7 @@ $ gnome-tweaks
218218

219219
在此之前我们可以通过:
220220

221-
```shell
221+
```console
222222
$ echo $SHELL
223223
```
224224

@@ -228,13 +228,13 @@ $ echo $SHELL
228228

229229
首先通过 apt 安装 `zsh`
230230

231-
```shell
231+
```console
232232
$ sudo apt install zsh
233233
```
234234

235235
将 zsh 设定为默认 shell:
236236

237-
```shell
237+
```console
238238
$ chsh -s /bin/zsh
239239
```
240240

@@ -250,7 +250,7 @@ $ chsh -s /bin/zsh
250250

251251
oh-my-zsh 是一个管理 zsh 配置的框架,评价也非常好。
252252

253-
```shell
253+
```console
254254
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
255255
```
256256

@@ -352,7 +352,7 @@ $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/t
352352

353353
### WordPress 的手动配置
354354

355-
```shell
355+
```console
356356
$ sudo apt install -y wordpress php libapache2-mod-php mysql-server php-mysql
357357
```
358358

@@ -378,15 +378,15 @@ Alias /blog /usr/share/wordpress
378378

379379
保存后输入命令来重启 `apache2`
380380

381-
```shell
381+
```console
382382
$ sudo a2ensite wordpress
383383
$ sudo a2enmod rewrite
384384
$ sudo service apache2 reload
385385
```
386386

387387
再配置数据库相关内容:
388388

389-
```shell
389+
```console
390390
$ sudo mysql -u root
391391
```
392392

@@ -452,7 +452,7 @@ define('WP_CONTENT_DIR', '/usr/share/wordpress/wp-content');
452452

453453
然后输入:
454454

455-
```shell
455+
```console
456456
$ sudo service mysql start
457457
```
458458

0 commit comments

Comments
 (0)