Use correct syntax markup for shell

Approved by:	carlavilla
This commit is contained in:
Li-Wen Hsu 2021-03-14 20:08:55 +08:00
parent 55c95407aa
commit a9a9e66105
No known key found for this signature in database
GPG key ID: 8D7BCC7D012FD37E
666 changed files with 17924 additions and 17924 deletions

View file

@ -117,14 +117,14 @@ link:https://www.FreeBSD.org/projects/ideas/[FreeBSD list of projects and ideas
例如:
[source,bash]
[source,shell]
....
% diff -c oldfile newfile
....
[source,bash]
[source,shell]
....
% diff -c -r olddir newdir
....
@ -133,14 +133,14 @@ link:https://www.FreeBSD.org/projects/ideas/[FreeBSD list of projects and ideas
或者像是...
[source,bash]
[source,shell]
....
% diff -u oldfile newfile
....
[source,bash]
[source,shell]
....
% diff -u -r olddir newdir
....

View file

@ -169,7 +169,7 @@ There is a judgement call here, of course, but the output of the man:dmesg[8] co
* A lot of the information you need to supply is the output of programs, such as man:dmesg[8], or console messages, which usually appear in [.filename]#/var/log/messages#. Do not try to copy this information by typing it in again; it is a real pain, and you are bound to make a mistake. To send log file contents, either make a copy of the file and use an editor to trim the information to what is relevant, or cut and paste into your message. For the output of programs like man:dmesg[8], redirect the output to a file and include that. For example,
+
[source,bash]
[source,shell]
....
% dmesg > /tmp/dmesg.out
....

View file

@ -143,7 +143,7 @@ The best way to mirror the FTP area is rsync. You can install the port package:n
一個需要mirror FreeBSD官網的指令如下:
[source,bash]
[source,shell]
....
% rsync -vaHz --delete rsync://ftp4.de.FreeBSD.org/FreeBSD/ /pub/FreeBSD/
....
@ -157,7 +157,7 @@ FreeBSD 網站應只能透過 rsync 指令來mirror.
一個 mirror FreeBSD 網站的指令應該看起像這樣:
[source,bash]
[source,shell]
....
% rsync -vaHz --delete rsync://bit0.us-west.freebsd.org/FreeBSD-www-data/ /usr/local/www/
....
@ -167,14 +167,14 @@ FreeBSD 網站應只能透過 rsync 指令來mirror.
由於對頻寬儲存空間和管理的要求非常高FreeBSD 計畫決定不允許公眾 mirror 套件. 對於擁有大量伺服主機的網站,建議為 man:pkg[8] 使用 HTTP proxy 快取可能會有所幫助。或者,您可以使用以下指令獲得套件與相依套件:
[source,bash]
[source,shell]
....
% pkg fetch -d -o /usr/local/mirror vim
....
一旦這些套件包被下載,就必須執行以下命令來產生套件庫數據:
[source,bash]
[source,shell]
....
% pkg repo /usr/local/mirror
....

View file

@ -66,7 +66,7 @@ __潤秒__是為了同步地球自轉與原子鐘所做的特定一秒的修
測試是否有使用潤秒是有可能的。由於 NTP 的性質測試可能要運作到潤秒前24小時。有些主要的參考時鐘來源只在潤秒前一個小時公告。詢問 NTP 行程:
[source,bash]
[source,shell]
....
% ntpq -c 'rv 0 leap'
....

View file

@ -117,7 +117,7 @@ FreeBSD mailing lists 主要是提供 FreeBSD 社群間的溝通管道,這裡
* 請確認:時間與時區設定是否正確。 這問題看起來有點蠢,因為你寄出的信還是會到達 mailing list 上, 但是呢,每位 mailing lists 上的訂戶每天都會看數百封的信, 他們通常會把信件以標題跟時間作為排序依據。 若你的信沒有在第一篇正解之前就先出現的話,他們就會假設可能是漏收你這封信, 然後就沒再去看你那封信了。
* 請提供程式出現的相關訊息,像是 man:dmesg[8] 或者 console messages 也就是通常會出現在 [.filename]#/var/log/messages# 出現的。 請不要用手打,因為這不僅很苦,而且也可能打錯字或亂掉原有格式。請直接把相關的 log 檔丟出來, 或是用編輯器來剪裁、或是用滑鼠複製/貼上來完成。舉個例子,如果是要把像是 `dmesg` 的程式訊息倒入到某個檔案去的話,那麼作法如下:
+
[source,bash]
[source,shell]
....
% dmesg > /tmp/dmesg.out
....

View file

@ -70,7 +70,7 @@ NanoBSD 提供的功能包括:
[example]
====
[source,bash]
[source,shell]
....
# vi /etc/resolv.conf
[...]
@ -94,7 +94,7 @@ NanoBSD 映像檔是透過使用非常簡單的 [.filename]#nanobsd.sh# shell sc
打造 NanoBSD 映像檔所需的指令是:
[source,bash]
[source,shell]
....
# cd /usr/src/tools/tools/nanobsd <.>
# sh nanobsd.sh <.>
@ -116,7 +116,7 @@ NanoBSD 映像檔是透過使用非常簡單的 [.filename]#nanobsd.sh# shell sc
執行下面的指令將會 [.filename]#nanobsd.sh# 讀取目前所在目錄的 [.filename]#myconf.nano# 檔的設定:
[source,bash]
[source,shell]
....
# sh nanobsd.sh -c myconf.nano
....
@ -249,7 +249,7 @@ customize_cmd cust_nobeastie
如果傳輸速度是第一要求的話,請採用下面例子:
[source,bash]
[source,shell]
....
# ftp myhost
get _.disk.image "| sh updatep1"
@ -259,7 +259,7 @@ get _.disk.image "| sh updatep1"
如果想更安全的話,應參考下面例子:
[source,bash]
[source,shell]
....
# ssh myhost cat _.disk.image.gz | zcat | sh updatep1
....
@ -271,7 +271,7 @@ get _.disk.image "| sh updatep1"
[.procedure]
. 首先,在提供映像檔的主機上開啟 TCP listen並讓它把映像檔傳給 client
+
[source,bash]
[source,shell]
....
myhost# nc -l 2222 < _.disk.image
....
@ -282,7 +282,7 @@ myhost# nc -l 2222 < _.disk.image
====
. 連到提供新映像檔服務的主機,並執行 [.filename]#updatep1# 這支 script
+
[source,bash]
[source,shell]
....
# nc myhost 2222 | sh updatep1
....

View file

@ -353,7 +353,7 @@ GNATS is picky about the format of a submitted bug report. This is why a lot of
When GNATS cannot deduce what to do with a problem report that reaches the database, it sets the responsible of the PR to `gnats-admin` and files it under the `pending` category. This is now a "misfiled" PR and will not appear in bug report listings, unless someone explicitly asks for a list of all the misfiled PRs. If you have access to the FreeBSD cluster machines, you can use `query-pr` to view a listing of PRs that have been misfiled:
[source,bash]
[source,shell]
....
% query-pr -x -q -r gnats-admin
52458 gnats-ad open serious medium Re: declaration clash f
@ -394,14 +394,14 @@ from the body of this PR to kern/12345
Searching with `query-pr` for the original PR, of which a misfiled followup is a reply, is as easy as running:
[source,bash]
[source,shell]
....
% query-pr -q -y "some text"
....
After you locate the original PR and the misfiled followups, use the `-F` option of `query-pr` to save the full text of all the relevant PRs in a UNIX(R) mailbox file, i.e.:
[source,bash]
[source,shell]
....
% query-pr -F 52458 52474 > mbox
....

View file

@ -147,7 +147,7 @@ The following applies to submitting PRs via email:
The man:send-pr[1] program has provisions for attaching files to a problem report. You can attach as many files as you want provided that each has a unique base name (i.e. the name of the file proper, without the path). Just use the `-a` command-line option to specify the names of the files you wish to attach:
[source,bash]
[source,shell]
....
% send-pr -a /var/run/dmesg -a /tmp/errors
....
@ -257,7 +257,7 @@ If you are using man:send-pr[1]:
Once you are done filling out the template, have saved it, and exit your editor, man:send-pr[1] will prompt you with [.prompt]#s)end, e)dit or a)bort?#. You can then hit `s` to go ahead and submit the problem report, `e` to restart the editor and make further modifications, or `a` to abort. If you choose the latter, your problem report will remain on disk (man:send-pr[1] will tell you the filename before it terminates), so you can edit it at your leisure, or maybe transfer it to a system with better net connectivity, before sending it with the `-F` to man:send-pr[1]:
[source,bash]
[source,shell]
....
% send-pr -f ~/my-problem-report
....

View file

@ -78,7 +78,7 @@ toc::[]
首先下載最新的 mfsBSD 並解壓縮之, 然後切到解壓縮後的工作目錄,也就是 mfsBSD script 檔所在處:
[source,bash]
[source,shell]
....
# fetch http://people.freebsd.org/~mm/mfsbsd/mfsbsd-latest.tar.gz
# tar xvzf mfsbsd-1.0-beta1.tar.gz
@ -130,7 +130,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
首先是把 FreeBSD 安裝光碟或者安裝用的 ISO image 檔丟到 [.filename]#/cdrom#。 為維持所有例子的一致,本文假設都是用 FreeBSD 7.0-RELEASE ISO。 而把 ISO image 檔掛載到 [.filename]#/cdrom# 目錄相當簡單, 就是用 man:mdconfig[8]
[source,bash]
[source,shell]
....
# mdconfig -a -t vnode -u 10 -f 7.0-RELEASE-amd64-disc1.iso
# mount_cd9660 /dev/md10 /cdrom
@ -138,7 +138,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
接著就開始打造可開機的 mfsBSD image
[source,bash]
[source,shell]
....
# make BASE=/cdrom/7.0-RELEASE
....
@ -152,14 +152,14 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
現在 mfsBSD image 已經備妥, 要上傳到遠端機器的救急系統或者預先安裝的 Linux(R) distribution。 要完成這工作最適合的工具就是 scp
[source,bash]
[source,shell]
....
# scp disk.img root@192.168.0.2:.
....
為了能順利啟動 mfsBSD image 要把檔案放在欲安裝機器的第一顆(可開機)硬碟上。 假設例子的第一顆開機硬碟代號為 [.filename]#sda# 那麼作法就類似下面這樣:
[source,bash]
[source,shell]
....
# dd if=/root/disk.img of=/dev/sda bs=1m
....
@ -177,7 +177,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
首先先把各硬碟都先清空。 請對各硬碟作下列指令:
[source,bash]
[source,shell]
....
# dd if=/dev/zero of=/dev/ad0 count=2
....
@ -186,7 +186,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
下面的例子會介紹如何建立 slice 以及 label、在每個分割區上啟用 man:gmirror[8]、如何在每個 mirrored 分割區上建立 UFS2 檔案系統:
[source,bash]
[source,shell]
....
# fdisk -BI /dev/ad0 <.>
# fdisk -BI /dev/ad1
@ -221,7 +221,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
這裡是最重要的一環, 本節介紹實際上如何在先前一節所做好的硬碟安裝最小化的 FreeBSD 為了完成此一目標,所有檔案系統都必須掛載妥當,才能讓 Sysinstall 可以把 FreeBSD 裝到硬碟內:
[source,bash]
[source,shell]
....
# mount /dev/mirror/root /mnt
# mkdir /mnt/var /mnt/usr
@ -253,7 +253,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
現在必須要用 man:chroot[8] 以切到剛剛新裝好的系統內。 指令如下:
[source,bash]
[source,shell]
....
# chroot /mnt
....
@ -262,7 +262,7 @@ ifconfig_re0="inet 192.168.0.2 netmask 255.255.255.0"
* 把 `GENERIC` kernel 複製到 [.filename]#/boot/kernel# 目錄:
+
[source,bash]
[source,shell]
....
# cp -Rp /boot/GENERIC/* /boot/kernel
....
@ -287,7 +287,7 @@ zfs_load="YES"
....
* 執行下列指令,以在下次開機時啟用 ZFS
+
[source,bash]
[source,shell]
....
# echo 'zfs_enable="YES"' >> /etc/rc.conf
....
@ -304,14 +304,14 @@ zfs_load="YES"
接下來只剩要調整 man:zpool[8] 以及建立 man:zfs[8] 檔案系統而已。 ZFS 的建立及管理是相當淺顯易懂。 首先, 建立 mirrored pool
[source,bash]
[source,shell]
....
# zpool create tank mirror /dev/ad[01]s1f
....
接著,建立檔案系統:
[source,bash]
[source,shell]
....
# zfs create tank/ports
# zfs create tank/src