如何使用bash逐行连接两个文件

前端之家收集整理的这篇文章主要介绍了如何使用bash逐行连接两个文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有两个文本文件,每个都包含一行信息,如此
  1. file1.txt file2.txt
  2. ---------- ---------
  3. linef11 linef21
  4. linef12 linef22
  5. linef13 linef23
  6. . .
  7. . .
  8. . .

我想使用bash脚本连接这些文件行,以获得:

  1. fileresult.txt
  2. --------------
  3. linef11 linef21
  4. linef12 linef22
  5. linef13 linef23
  6. . .
  7. . .
  8. . .

如何使用bash脚本做到这一点?

您可以使用 paste
  1. paste file1.txt file2.txt > fileresults.txt

猜你在找的Bash相关文章