● 使用 vi 編輯,Suspended 後,要再繼續編輯
# fg
● Boot Messages
# dmesg -a
● Renew DHCP IP Address
# dhclient name-of-your-ethernet-interface
● 已開機時間
# top
# uptime
● 升級、更新
# freebsd-update fetch
# freebsd-update install
# freebsd-update upgrade -r 11.3-RELEASE
● 查 CPU 型號規格
# sysctl hw.model
● 查 CPU 數量
# sysctl kern.smp.cpus
● 查詢系統磁碟空間使用情況
# df
● 查看目錄容量大小
# du
-h : "Human-readable" output.
-d depth : 顯示目錄深度。
● 下載檔案
# fetch
-o file : Set the output file name to file.
● 列出所有帳戶
# logins
.==================================================================================================== iconv – 檔案轉換編碼 範例語法: iconv -f big5 -t utf-8 big5.txt -o utf8.txt iconv -f big5 -t utf-8 big5.txt > utf8.txt ==================================================================================================== ls – -l 一個檔案一列 -t 照時間排序(最新在前面) -rt 照時間排序(最新在後面) ==================================================================================================== mount_smbfs 範例語法: mount_smbfs -I 192.168.0.212 -N ‘//Jimmy/Upload’ /mnt ※ 掛載 Windows 分享 ==================================================================================================== openssl 範例語法: openssl genrsa -out rsa.pem 1024 ※ 產生 private key openssl rsa -in rsa.pem -pubout ※ 計算 public key ==================================================================================================== passwd – 修改密碼 ==================================================================================================== sysctl 範例語法: sysctl hw.model ※ 可以查 CPU 型號規格 sysctl kern.smp.cpus ※ 可以查 CPU 數量 ==================================================================================================== tar – -p 保留檔案的屬性 Preserve file permissions -C 改變壓縮或解壓縮的目錄 –exclude 排除不想備份的目錄或檔案 ==================================================================================================== umount 範例語法: umount /mnt ==================================================================================================== uname – -a 顯示 FreeBSD 的版本 ==================================================================================================== uptime – 已開機時間 ==================================================================================================== # fdisk -I /dev/da1 -I : Initialize sector 0 slice table for one FreeBSD slick covering the entire disk ==================================================================================================== # bsdlabel -w /dev/da1s1 Create a label for da1s1 ==================================================================================================== # newfs -U /dev/da1s1 -U : Enable soft updates on the new file system ====================================================================================================