Ubuntu how to combine multiple text files into one with terminal

。_饼干妹妹 提交于 2019-12-04 02:20:16

问题


I want to combine multiple text files into one text file. Is there any command in ubuntu terminal to do this, or do I have to do it manually?


回答1:


Try cat like

cat file1 file2 file3 > outputFile

cat stands for concatenation.

> is for output redirection.

If outputFile already has something in it and you wish to append to it the contents of other files, use

cat file1 file2 file3 >> outputFile

as > would erase the old contents of outputFile if it already existed.

Have a look here as well.



来源:https://stackoverflow.com/questions/47240577/ubuntu-how-to-combine-multiple-text-files-into-one-with-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!