At 2007-05-10T09:23:52+1200, Nick Rout wrote:
> I feel I should know this, but nothing comes to mind. I need to truncate a
> 6.5G file to the first 2G of the file. The remainder can be thrown away.
> There is no space left on the filesystem. So whatever I do has to be done
> to the original, copying the first 2G to another file is not going to cut
> the mustard.

> man [2|3p] truncate seems to reveal a c function, but I cannot find a
> command line equivalent.

Use dd(1), e.g.:

% ls -lh bigfile
-rw-r--r-- 1 kinetik kinetik 954G 2007-05-10 09:52 bigfile

% dd bs=1 seek=424935705 if=/dev/null of=bigfile
0+0 records in
0+0 records out
0 bytes (0 B) copied, 5.6991e-05 seconds, 0.0 kB/s

% ls -lh bigfile
-rw-r--r-- 1 kinetik kinetik 406M 2007-05-10 09:54 bigfile

Cheers,
-mjg
-- 
Matthew Gregan                     |/
                                  /|                    [EMAIL PROTECTED]

Reply via email to