views:

185

answers:

4

How can I put .Txt file A at the end of .Txt file B in terminal without opening the files?

+9  A: 

Do you mean without opening them in an editor? Use cat:

cat A >> B

The >> redirects the output of the cat command (which output file A) to the file B. But instead of overwriting contents of B, it appends to it. If you use a single >, it will instead overwrite any previous content in B.

Johannes Schaub - litb
+8  A: 
cat A >> B

Should do it. Not sure what you mean by "not opening", of course the files must be opened, in the operating system sense of the word, for this to happen.

The double arrow is "append".

unwind
A: 

Isn't it trivial?

cat A >> B
Eugene Morozov
If it was trivial, the question wouldn't be asked.
Alex Reynolds
-1. We're here to answer questions and help people, not cast aspersions. Get the chip off your shoulder.
Alex Reynolds
Who has the chip on their shoulder?
Judge Maygarden
+1  A: 

I am not sure what you mean by "opening the files", but

$ cat a.txt >> b.txt

should do the trick.

Terje Mikal