Results 1 to 6 of 6
Hi,
how do I copy two files into one file?
In *BLEH* windows/dos it can be:
copy /B source1 + source2 destination /B [B for binary]
(I could not make ...
- 06-20-2006 #1Just Joined!
- Join Date
- Jun 2006
- Posts
- 3
How to copy two files into one?
Hi,
how do I copy two files into one file?
In *BLEH* windows/dos it can be:
copy /B source1 + source2 destination /B [B for binary]
(I could not make dd or cp do it)
Thanx
- 06-20-2006 #2Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,065
Hi, LinuxUserToBe.
The name of utility cat is short for [con]catenate; see man cat ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 06-20-2006 #3Just Joined!
- Join Date
- Jun 2006
- Posts
- 3
Hi!
...thanx for the answer and for the quick reply!
- 06-21-2006 #4
Well, that's half the answer. For the other half, you need to know about redirection.
The greater-than (>) symbol is used to redirect input to a given output. For example,
will put the contents of file1 into newfile, instead of printing it to the screen.Code:$ cat file1 > newfile
In your case, what you want is the append symbol (>>). It will take the input and attach it to the end of a given file. So,
put the contents of file1 and file2 together into newfile. Conveniently, newfile doesn't need to exist before you give the command--cat will make it for you. Of course, if it does exist already, then file1 and file2 will just get appended to the end of it.Code:$ cat file1 file2 >> newfile
Stand up and be counted as a Linux user!
- 06-21-2006 #5Linux Engineer
- Join Date
- Apr 2006
- Location
- Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
- Posts
- 1,065
Hi, Zelmo.
Thanks for extending my reply ... cheers, drlWelcome - get the most out of the forum by reading forum basics and guidelines: click here.
90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
We look forward to helping you with the challenge of the other 10%.
( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )
- 06-21-2006 #6Just Joined!
- Join Date
- Jun 2006
- Posts
- 3
Hi Zelmo,
and thanx for the info.


Reply With Quote
