精華區beta FreeBSD 關於我們 聯絡資訊
==> 在 [email protected] (Ptp) 的文章中提到: > vi /var/log/maillog 時, 若想存第 n ~ m 行的資料到另一檔案 > 指令 :n,m copy /tmp/err.txt 會出現 Pattern not found > 若 :n,m copy err.txt 會出現 err.txt: bad line specification > 平時都用 copy 另存他檔, 再用 vi, set nu, 然後刪除不必要的行 > 只取檔案其中幾行, 要刪掉檔首及檔尾..有點麻煩 > 不知 vi 是否有像漢書或PE2 可以 mark line 再 paste 到另一檔案的功能 基本上我若要看 log 會先在 shell 下 copy 到別的檔看 例 cp maillog abc 按 : 到左下角 輸入 1,20 w 123.txt 按 enter 就好 同理可證 若要刪除 1,20 的話 1,20 d 慢慢來吧 vi 寫程式是真的很好用的 -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>