truncate a 2gig file ?
bhards at bigpond.net.au
Wed Nov 27 17:44:58 EST 2002
-----BEGIN PGP SIGNED MESSAGE-----
On Wed, 27 Nov 2002 17:20, Peter Barker wrote:
> On Wed, 27 Nov 2002, Simon Burton wrote:
> > I have a 2gig file (leunig's interview thismorning on ABC classic fm)
> > that i only need the first 700mb of, i haven't the disk space to
> > dd it, i'm looking to just chop off the last 1.3gig or so.
> perl -e 'truncate "foo", 4096 or die qq%Bugger: \$!%';
> where foo is your file, 4096 is 1.3G :-)
In python, something of the form:
>>> myfile = file("foo", "a")
is probably about equivalent, although perhaps a bit more readable :)
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----
More information about the linux