Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Bash snippet - Allocate a file without physical pre-allocation (a sparse file).
SUBMITTED BY:
DanielK
DATE:
Aug. 13, 2016, 2:58 p.m.
FORMAT:
Bash
SIZE:
183 Bytes
Raw
Download
Tweet
HITS:
770
Go to comments
Report
function
alloc_file
()
{
if
[
$#
-gt
1
]
;
then
dd
if
=
/dev/zero
bs
=
1
of
=
"
${
1
}
"
count
=
0
seek
=
${
2
}
else
echo
"
${
FUNCNAME
}
<path> <size> [K,M,G suffixes allowed]"
fi
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus