bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cut -b on huge files


From: Pádraig Brady
Subject: Re: cut -b on huge files
Date: Thu, 9 Oct 2008 11:35:47 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Klein, Roger wrote:
> Hi,
>  
> Now I found a hint on the Web
> (http://www.programmersheaven.com/mb/linux/187697/245244/re-how-to-chang
> e-filesize-in-linux/?S=B20000)

using `cut` to remove both truncate and "unsparse" files
is both inefficient an buggy. From the cut man page:

"cut - remove sections from each line of files"

The important word here is _line_
I.E. if there are any \n characters in the file
then the byte counts will be reset and
you'll get a bigger file than expected.

I suggest you do:

head --bytes=58101760 boot_image.clone2fs > boot_image.clone2fs_correct

cheers,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]