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 |
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). |
|
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. |
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. |