$ seq 10 20 | sed -n '1p;$p' 10 20
あたま数行を出したいだけなら、カンマ区切りで切れば良いです。
末尾数行ってのはやや苦しい感じです
$ seq 10 20 | sed -n '1,3p' 10 11 12
参考もと
sed -n '1p;$p' # Print the first and last line of stdin.
— Command Line Magic (@climagic) 2015, 9月 16
$ seq 10 20 | sed -n '1p;$p' 10 20
あたま数行を出したいだけなら、カンマ区切りで切れば良いです。
末尾数行ってのはやや苦しい感じです
$ seq 10 20 | sed -n '1,3p' 10 11 12
sed -n '1p;$p' # Print the first and last line of stdin.
— Command Line Magic (@climagic) 2015, 9月 16