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
2009-03-10 13:17:30
+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
2009-03-10 13:17:34
If it was trivial, the question wouldn't be asked.
Alex Reynolds
2009-03-10 13:21:08
-1. We're here to answer questions and help people, not cast aspersions. Get the chip off your shoulder.
Alex Reynolds
2009-03-10 14:02:37
Who has the chip on their shoulder?
Judge Maygarden
2009-03-10 14:13:32
+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
2009-03-10 13:20:09