假设我的文件file1.txt
名为1,2,3.. upto 100 linewise.
$> head -n 5 file1.txt //will display first 5 lines i.e. 1,2,3,4,5
$> tail -n 5 file1.txt // will display last 5 lines i.e. 96,97,98,99,100
我想在 1 个命令中将内容显示为前 5 行和后 5 行,
$> head tail -n 5 file1.txt // Something like this 1,2,3,4,5 96,97,98,99,100 (both together)
我怎样才能做到这一点?