LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Combining Files (https://www.linuxquestions.org/questions/linux-newbie-8/combining-files-96572/)

GameboyHippo 09-24-2003 11:30 PM

Combining Files
 
Hi, I was wondering what the command is to combine two binary files into one. The DOS command is:

copy /b file1+file2 newFile

Azmeen 09-24-2003 11:54 PM

Hmm... it seems to me that the only useful files to combine would be ASCII (text) files, and not binaries.

However, in *nix you can append files (what copy file1+file2 does in DOS) by typing this: cat file1 >> file2. I'm not sure whether the cp command has something similar (can't check now... at work).

win32sux 09-24-2003 11:56 PM

http://www.die.net/doc/linux/man/man1/cat.1.html

http://www-106.ibm.com/developerwork...l-tiptex2.html

http://www.redhat.com/docs/manuals/l...-usingcat.html

GameboyHippo 09-25-2003 12:15 PM

I actually did some research last night and found out that the answer to my problem is cat file1 file2 > newFile. In response to the above statement it is useful in the following situation.

Lets say you were making an emulator to run on a system such as the Gameboy Advance where all GBA files are a single Binary image. So in order for this to work, you must append the image of the console being emulated to the GBA image to get a single image you can burn to the Flash Linker. I've been doing work on the Gameboy Advance for awhile, but I want to start moving all my developement work to Linux.

sib_99 09-25-2003 01:38 PM

Yes, you can cat as many files as you want by
cat file1 file2 file3... > big file

cat file1 >> file2 just appends the content of the first file at the end of the second file.


All times are GMT -5. The time now is 04:22 PM.