在linux中,将文件filel的前20行,文件file2的最后15行合并成一个文件AB.txt

2025-02-25 18:43:51
推荐回答(2个)
回答1:

head -n 20 filel > AB.txt
tail -n 15 file2 >> AB.txt
两个命令,挨个执行,要先执行上面的在执行下面的。不然会看不到的哦。。

回答2:

head -n 20 filel > AB.txt
head -n -15 file2 >> AB.txt