※ 引述《gigaftp <[email protected]>, 看板: FreeBSD》之銘言:
: ※ 引述 edtx ([email protected]) 之銘言
: > 請教一下, 在 shell 下面 不進入 vi
: > 若想存一個文字檔第 n ~ m 行的資料到另一檔案
: > 有工具可以做到嗎??
: 這個簡單,要貼 n~m 行
: x = m - n + 1
: head -m txtfile | tail -x > outfile
另一個方法,以 3-20行 為例:
sed -n 3,20p txtfile > outfile
--
※ 發信站: 批踢踢實業坊(ptt.csie.ntu.edu.tw)
◆ From: 140.112.252.172