Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jun 2005 16:06:42 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        "Andrew L. Gould" <algould@datawok.com>
Cc:        Olivier Nicole <on@cs.ait.ac.th>, freebsd-questions@freebsd.org
Subject:   Re: OT: usage of split
Message-ID:  <20050620130642.GA984@flame.pc>
In-Reply-To: <200506192237.18337.algould@datawok.com>
References:  <200506192231.18309.algould@datawok.com> <200506200334.j5K3YVVi064949@banyan.cs.ait.ac.th> <200506192237.18337.algould@datawok.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2005-06-19 22:37, "Andrew L. Gould" <algould@datawok.com> wrote:
>On Sunday 19 June 2005 10:34 pm, Olivier Nicole wrote:
>>> 2.  How does one rejoin the resulting split files to recreate the
>>> original file?  I assume you can cat text files into a new file
>>> using redirection (>>); but can you do that with a binary file?
>>
>> I'd say yes, you can cat a binary file (though it is likely to
>> mess-up your screen).
>
> That's what virtual terminals are for!  ;-)
> What's a better way of rejoining split parts of a binary file?

If you split a binary file using split(1), then just rejoin the parts
with cat(1):

	% split -b 1400000 largefile.bin
	% cat x[a-z][a-z] > largefile2.bin

After these two steps, you should have:

	largefile.bin		The original binary file.

	xaa, xab, ...		Chunks of the original file that can fit
				in 1.4MB floppies (does anyone use these
				anymore?)

	largefile2.bin		A second copy of the original file, that
				was created by joining the x[a-z][a-z]
				chunks that split(1) created

After writing this post, I realized that split(1) doesn't have an
EXAMPLES section.  I think we should add one :)

- Giorgos




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050620130642.GA984>