※ 引述《[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 到另一檔案的功能
用 vim,把要的部分用 V 選好以後按「:w a」就會存到 a 這個檔案裡面去。
--
Resistance is futile.
<[email protected]>
--
※ Origin: 邪惡小鹿鹿 <Deer.twbbs.org> ◆ From: news.math.nctu.edu.tw