推 ll8833:sed -n '2,3p' file.txt 07/03 22:29
推 ll8833:-n 是將處理過的行輸出 因為你下的意思表示1~4行都列出 07/03 22:40
→ ll8833:所以改成2~3行就可以 07/03 22:40
推 appleboy46:利用 grep -v 也可以啦 07/04 01:59
→ Xphenomenon:但是這是在知道行數的狀況下,如果行數是未知呢? @@ 07/04 14:39
→ n3oanderson:grep -A 1 /path/to/file_to_be_searched 07/04 16:35
→ n3oanderson:grep -A 1 _key_ /path/to/file_to_be_searched 07/04 16:36
→ p2k:sed -n '/aa/,/dd/p' file.txt | sed -e '1d' -e '$d' 07/04 16:56
→ Xphenomenon:感謝 ^^ 07/05 19:21