War*_*ega 11 unix bash shell terminal copy-paste
我试图将.txt文件的一部分从行号n复制到行号n + y(假设1000到1000000).
我试过运营商和sed,但它失败了.这是我试过的命令:
sed -n "1000, 1000000p" path/first/file > path/second/file
Run Code Online (Sandbox Code Playgroud)
Fre*_*lip 22
如果您知道源文件(wc -l)中有多少行,则可以执行此操作.假设12000行,并且您希望新文件中的行2000 - 7000(总共5000行).
cat myfile | 尾巴-10000 | head -5000> newfile
读取最后10k行,然后读取第1行5k行.