On Tue, 2003-06-24 at 15:54, Volker Kuhlmann wrote:
> Is there a shell command which can truncate a file to the given number
> of bytes? It would need to work with large files (i.e. >> 2GB).
> 
> Thanks,
> 
> Volker

If it's a text file then how about,

cat your_file | tail --bytes=N > your_file

where N is the number of bytes to be kept. Can piping be made to operate
serially using a temporary file? Perhaps this is a little dangerous to
be writing back to the same file. Maybe a short script? Rambling
again.... :>
-- 
Rob Stockley
Manawatu
New Zealand

An avid user of RedHat Linux
Visit http://www.redhat.com

Reply via email to