Discussion:
Linux truncate(1) equivalent?
Emmanuel Dreyfus
2014-07-10 13:49:23 UTC
Permalink
Hi

Do we have an équivalent of Linux truncate(1)? It calls truncate(2)
to resize a file.

I tried dd with seek with no success.
--
Emmanuel Dreyfus
***@netbsd.org
Greg Troxel
2014-07-10 15:38:42 UTC
Permalink
Do we have an équivalent of Linux truncate(1)? It calls truncate(2)
to resize a file.
I tried dd with seek with no success.
see pkgsrc/sysutils/coreutils, whose PLIST has

bin/gtruncate
Martin Neitzel
2014-07-10 17:43:21 UTC
Permalink
Do we have an équivalent of Linux truncate(1)? It calls truncate(2)
to resize a file.
I tried dd with seek with no success.
Works for me:

fortune -l > xx
dd bs=1 seek=10 if=/dev/null of=xx
ls -l xx ; od -a xx

Martin
Emmanuel Dreyfus
2014-07-10 19:08:50 UTC
Permalink
Post by Martin Neitzel
fortune -l > xx
dd bs=1 seek=10 if=/dev/null of=xx
ls -l xx ; od -a xx
Indeed that one works. I was close to it but not enough.
--
Emmanuel Dreyfus
***@netbsd.org
Loading...