Unable to put a .txt -file to the end of another .txt -file
-
08-07-2019 - |
Question
How can I put .Txt file A at the end of .Txt file B in terminal without opening the files?
Solution
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
.
OTHER TIPS
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".
I am not sure what you mean by "opening the files", but
$ cat a.txt >> b.txt
should do the trick.
Isn't it trivial?
cat A >> B
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow