2

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?

James Ele
  • 111
  • 3
  • 13
  • 1
    Possible duplicate of [merge two text files using bash scripts in linux](https://stackoverflow.com/questions/45368766/merge-two-text-files-using-bash-scripts-in-linux) – Anastasios Selmani Nov 11 '17 at 17:29

1 Answers1

4

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.

J...S
  • 5,079
  • 1
  • 20
  • 35