[Techtalk] Copying a file + archive to one file

Carla Schroder carla at bratgrrl.com
Sat Feb 25 00:00:52 EST 2006


On Thursday 23 February 2006 07:22, Becky Brewer wrote:
> Hi everyone,
>
> I am somewhat of a Linux newbie - just getting back into it after a couple
> of years on MS systems.  I'm trying to copy a file plus a zip archive into
> one file (an exe), and from what I've read the cp command is not able to do
> this.   In DOS, the command I would use to perform this action is:
>
> copy /B myapp.exe+myzip.zip mynewapp.exe
>
> I know that two or more files may be copied to a directory using the cp
> command, but have not found any documentation indicating that two files may
> be copied into the third in Linux, as they could be in DOS.  The mv command
> seems to work the same way.
>
> Am I missing something?  Is there another command that I am not aware of
> that is capable of performing this action?  This needs to be a command-line
> operation, and I am running Redhat 9 on this machine.  Any advice would be
> appreciate - TIA!
>

I think you want tar, though I don't know if it support zip and exe files, 
which are windows formats. To create a tar archive, do this:

tar cvf foo.tar  filename1 filename2

this means "create a new archive named foo.tar with filename1 and filename2"

Unpacking it goes like this:

tar xvf foo.tar

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Carla Schroder
 check out my "Linux Cookbook", the ultimate Linux user's
 and sysadmin's guide! http://www.oreilly.com/catalog/linuxckbk/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the Techtalk mailing list