Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-25-2003, 12:30 AM   #1
Registered: Mar 2003
Location: Bible Belt USA
Distribution: Debian
Posts: 91

Rep: Reputation: 15
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
Old 09-25-2003, 12:54 AM   #2
Senior Member
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
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).
Old 09-25-2003, 01:15 PM   #4
Registered: Mar 2003
Location: Bible Belt USA
Distribution: Debian
Posts: 91

Original Poster
Rep: Reputation: 15
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.
Old 09-25-2003, 02:38 PM   #5
LQ Newbie
Registered: Sep 2003
Posts: 6

Rep: Reputation: 0
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Debian iso files to DVD Kilahchris Linux - Newbie 6 05-02-2006 04:04 AM
Combining files into one cobra7x Linux - General 10 05-05-2005 02:39 AM
combining multiple rar files jollyjoice Linux - Newbie 2 04-02-2005 03:49 PM
Combining text files ebiven Linux - General 12 07-22-2004 12:13 PM
combining mpeg files plisken Programming 0 03-04-2002 05:47 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration