Generate File of a certain size?How can I limit downloaded file size in wget?Way to determine where certain global parameter is configuredDelete files of certain size rangeFind the total size of certain files within a directory branchAutomatically detect when a file has reached a size limitSort files into directories named by prefix of fileGenerating files of varying variability?Copy All Files With Certain Length File NameHow to generate a set of new different files through shell scripting given a certain pattern name?searching/showing size of files
The magic money tree problem
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
Copycat chess is back
Should I join office cleaning event for free?
New order #4: World
What makes Graph invariants so useful/important?
Why is "Reports" in sentence down without "The"
LED on same Pin as Toggle Switch, not illuminating
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
My colleague's body is amazing
How does one intimidate enemies without having the capacity for violence?
Why don't electron-positron collisions release infinite energy?
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
XeLaTeX and pdfLaTeX ignore hyphenation
Why is this code 6.5x slower with optimizations enabled?
Is there really no realistic way for a skeleton monster to move around without magic?
Can a German sentence have two subjects?
Could a US political party gain complete control over the government by removing checks & balances?
Draw simple lines in Inkscape
What is the meaning of "of trouble" in the following sentence?
Why was the small council so happy for Tyrion to become the Master of Coin?
Do airline pilots ever risk not hearing communication directed to them specifically, from traffic controllers?
A function which translates a sentence to title-case
Generate File of a certain size?
How can I limit downloaded file size in wget?Way to determine where certain global parameter is configuredDelete files of certain size rangeFind the total size of certain files within a directory branchAutomatically detect when a file has reached a size limitSort files into directories named by prefix of fileGenerating files of varying variability?Copy All Files With Certain Length File NameHow to generate a set of new different files through shell scripting given a certain pattern name?searching/showing size of files
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'd like to generate a file with the name example.file
. I could use
touch example.file
but I want the file to be exactly 24MB in size. I already checked the manpage of touch, but there is no parameter like this. Is there an easy way to generate files of a certain size?
bash command-line files
add a comment |
I'd like to generate a file with the name example.file
. I could use
touch example.file
but I want the file to be exactly 24MB in size. I already checked the manpage of touch, but there is no parameter like this. Is there an easy way to generate files of a certain size?
bash command-line files
2
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12
add a comment |
I'd like to generate a file with the name example.file
. I could use
touch example.file
but I want the file to be exactly 24MB in size. I already checked the manpage of touch, but there is no parameter like this. Is there an easy way to generate files of a certain size?
bash command-line files
I'd like to generate a file with the name example.file
. I could use
touch example.file
but I want the file to be exactly 24MB in size. I already checked the manpage of touch, but there is no parameter like this. Is there an easy way to generate files of a certain size?
bash command-line files
bash command-line files
edited Nov 16 '13 at 21:14
Gilles
546k12911111625
546k12911111625
asked Nov 15 '13 at 19:54
R_UserR_User
613265
613265
2
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12
add a comment |
2
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12
2
2
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12
add a comment |
5 Answers
5
active
oldest
votes
You can use dd:
dd if=/dev/zero of=output.dat bs=24M count=1
or
dd if=/dev/zero of=output.dat bs=1M count=24
or, on Mac,
dd if=/dev/zero of=output.dat bs=1m count=24
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
Maybe dont use huge block sizes, my system did not likebs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercasem
too.
– Erik
Apr 12 '18 at 11:56
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
|
show 1 more comment
Under non-embedded Linux or Cygwin (or any system with GNU coreutils) and FreeBSD:
truncate -s 24m example.file
This creates a file full of null bytes. If the file already exists and is smaller, it is extended to the requested size with null bytes. If the file already exists and is larger, is is truncated to the requested size.
The null bytes do not consume any disk space, the file is a sparse file.
On many systems, head -c 24m </dev/zero >example.file
creates a non-sparse file full of null bytes. If head
doesn't have a -c
option on your system (it's common but not in POSIX), you can use dd bs=1024k count=24 </dev/zero >example.file
instead (this is POSIX-compliant).
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
add a comment |
If you don't care about the content of the file, this is much faster than using dd
:
fallocate -l 24M filename
Obviously, using dd
for a 24MB file won't take any time on a modern system, but larger files can be noticeably slow.
add a comment |
You can use dd:
dd if=/dev/zero of=outputfile.out bs=1024k count=24
Or in case you happen to be using Solaris
mkfile 24m outputfile.out
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass-n
to create a sparse file
– russbishop
Dec 8 '17 at 17:29
add a comment |
FROM_NODE=N01;
echo; cd $MOUNT_PATH; pwd; ls -la; sleep 1; echo;
WHEN="$(date +%Y-%m-%d_%H-%M-%S)";
fallocate -l 10M $MOUNT_PATH/"$FROM_NODE"_"$WHEN".dump
ls -lha; echo;
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.
– JigglyNaga
Jan 19 '17 at 20:41
1
If you prefer sir:fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f101332%2fgenerate-file-of-a-certain-size%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use dd:
dd if=/dev/zero of=output.dat bs=24M count=1
or
dd if=/dev/zero of=output.dat bs=1M count=24
or, on Mac,
dd if=/dev/zero of=output.dat bs=1m count=24
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
Maybe dont use huge block sizes, my system did not likebs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercasem
too.
– Erik
Apr 12 '18 at 11:56
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
|
show 1 more comment
You can use dd:
dd if=/dev/zero of=output.dat bs=24M count=1
or
dd if=/dev/zero of=output.dat bs=1M count=24
or, on Mac,
dd if=/dev/zero of=output.dat bs=1m count=24
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
Maybe dont use huge block sizes, my system did not likebs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercasem
too.
– Erik
Apr 12 '18 at 11:56
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
|
show 1 more comment
You can use dd:
dd if=/dev/zero of=output.dat bs=24M count=1
or
dd if=/dev/zero of=output.dat bs=1M count=24
or, on Mac,
dd if=/dev/zero of=output.dat bs=1m count=24
You can use dd:
dd if=/dev/zero of=output.dat bs=24M count=1
or
dd if=/dev/zero of=output.dat bs=1M count=24
or, on Mac,
dd if=/dev/zero of=output.dat bs=1m count=24
edited Mar 27 at 15:28
Clay
1033
1033
answered Nov 15 '13 at 20:01
Paul92Paul92
1,453188
1,453188
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
Maybe dont use huge block sizes, my system did not likebs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercasem
too.
– Erik
Apr 12 '18 at 11:56
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
|
show 1 more comment
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
Maybe dont use huge block sizes, my system did not likebs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercasem
too.
– Erik
Apr 12 '18 at 11:56
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
1
1
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
... or use bs=1M and count=24. Many find it nicer and easier to read.
– Bgs
Nov 15 '13 at 20:11
3
3
Maybe dont use huge block sizes, my system did not like
bs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
Maybe dont use huge block sizes, my system did not like
bs=1G count=1
– ThorSummoner
Dec 7 '16 at 0:17
10
10
On the Mac, use 24m (small m), because the Mac doesn't like the big M.
dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
On the Mac, use 24m (small m), because the Mac doesn't like the big M.
dd if=/dev/zero of=output.dat bs=24m count=1
– SPRBRN
Feb 13 '17 at 13:30
1
1
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercase
m
too.– Erik
Apr 12 '18 at 11:56
On Android (5.1.1, might (not) be version or phone specific) I had to use a lowercase
m
too.– Erik
Apr 12 '18 at 11:56
1
1
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
What is the problem with large block sizes specifically? I had hoped to use a 1G block size for a 1G file.
– felwithe
Jan 5 at 15:03
|
show 1 more comment
Under non-embedded Linux or Cygwin (or any system with GNU coreutils) and FreeBSD:
truncate -s 24m example.file
This creates a file full of null bytes. If the file already exists and is smaller, it is extended to the requested size with null bytes. If the file already exists and is larger, is is truncated to the requested size.
The null bytes do not consume any disk space, the file is a sparse file.
On many systems, head -c 24m </dev/zero >example.file
creates a non-sparse file full of null bytes. If head
doesn't have a -c
option on your system (it's common but not in POSIX), you can use dd bs=1024k count=24 </dev/zero >example.file
instead (this is POSIX-compliant).
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
add a comment |
Under non-embedded Linux or Cygwin (or any system with GNU coreutils) and FreeBSD:
truncate -s 24m example.file
This creates a file full of null bytes. If the file already exists and is smaller, it is extended to the requested size with null bytes. If the file already exists and is larger, is is truncated to the requested size.
The null bytes do not consume any disk space, the file is a sparse file.
On many systems, head -c 24m </dev/zero >example.file
creates a non-sparse file full of null bytes. If head
doesn't have a -c
option on your system (it's common but not in POSIX), you can use dd bs=1024k count=24 </dev/zero >example.file
instead (this is POSIX-compliant).
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
add a comment |
Under non-embedded Linux or Cygwin (or any system with GNU coreutils) and FreeBSD:
truncate -s 24m example.file
This creates a file full of null bytes. If the file already exists and is smaller, it is extended to the requested size with null bytes. If the file already exists and is larger, is is truncated to the requested size.
The null bytes do not consume any disk space, the file is a sparse file.
On many systems, head -c 24m </dev/zero >example.file
creates a non-sparse file full of null bytes. If head
doesn't have a -c
option on your system (it's common but not in POSIX), you can use dd bs=1024k count=24 </dev/zero >example.file
instead (this is POSIX-compliant).
Under non-embedded Linux or Cygwin (or any system with GNU coreutils) and FreeBSD:
truncate -s 24m example.file
This creates a file full of null bytes. If the file already exists and is smaller, it is extended to the requested size with null bytes. If the file already exists and is larger, is is truncated to the requested size.
The null bytes do not consume any disk space, the file is a sparse file.
On many systems, head -c 24m </dev/zero >example.file
creates a non-sparse file full of null bytes. If head
doesn't have a -c
option on your system (it's common but not in POSIX), you can use dd bs=1024k count=24 </dev/zero >example.file
instead (this is POSIX-compliant).
answered Nov 17 '13 at 22:18
GillesGilles
546k12911111625
546k12911111625
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
add a comment |
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
BusyBox also has it, so most embedded systems will too :-)
– Ciro Santilli 新疆改造中心996ICU六四事件
Oct 3 '18 at 1:46
add a comment |
If you don't care about the content of the file, this is much faster than using dd
:
fallocate -l 24M filename
Obviously, using dd
for a 24MB file won't take any time on a modern system, but larger files can be noticeably slow.
add a comment |
If you don't care about the content of the file, this is much faster than using dd
:
fallocate -l 24M filename
Obviously, using dd
for a 24MB file won't take any time on a modern system, but larger files can be noticeably slow.
add a comment |
If you don't care about the content of the file, this is much faster than using dd
:
fallocate -l 24M filename
Obviously, using dd
for a 24MB file won't take any time on a modern system, but larger files can be noticeably slow.
If you don't care about the content of the file, this is much faster than using dd
:
fallocate -l 24M filename
Obviously, using dd
for a 24MB file won't take any time on a modern system, but larger files can be noticeably slow.
edited Sep 26 '17 at 8:14
Socowi
1485
1485
answered Jul 24 '17 at 4:35
SArcherSArcher
35337
35337
add a comment |
add a comment |
You can use dd:
dd if=/dev/zero of=outputfile.out bs=1024k count=24
Or in case you happen to be using Solaris
mkfile 24m outputfile.out
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass-n
to create a sparse file
– russbishop
Dec 8 '17 at 17:29
add a comment |
You can use dd:
dd if=/dev/zero of=outputfile.out bs=1024k count=24
Or in case you happen to be using Solaris
mkfile 24m outputfile.out
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass-n
to create a sparse file
– russbishop
Dec 8 '17 at 17:29
add a comment |
You can use dd:
dd if=/dev/zero of=outputfile.out bs=1024k count=24
Or in case you happen to be using Solaris
mkfile 24m outputfile.out
You can use dd:
dd if=/dev/zero of=outputfile.out bs=1024k count=24
Or in case you happen to be using Solaris
mkfile 24m outputfile.out
answered Nov 15 '13 at 20:25
BitsOfNixBitsOfNix
4,21821832
4,21821832
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass-n
to create a sparse file
– russbishop
Dec 8 '17 at 17:29
add a comment |
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass-n
to create a sparse file
– russbishop
Dec 8 '17 at 17:29
2
2
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
mkfile seems to be present on macOS too
– Ben Flynn
Sep 19 '16 at 20:28
You can also pass
-n
to create a sparse file– russbishop
Dec 8 '17 at 17:29
You can also pass
-n
to create a sparse file– russbishop
Dec 8 '17 at 17:29
add a comment |
FROM_NODE=N01;
echo; cd $MOUNT_PATH; pwd; ls -la; sleep 1; echo;
WHEN="$(date +%Y-%m-%d_%H-%M-%S)";
fallocate -l 10M $MOUNT_PATH/"$FROM_NODE"_"$WHEN".dump
ls -lha; echo;
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.
– JigglyNaga
Jan 19 '17 at 20:41
1
If you prefer sir:fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
add a comment |
FROM_NODE=N01;
echo; cd $MOUNT_PATH; pwd; ls -la; sleep 1; echo;
WHEN="$(date +%Y-%m-%d_%H-%M-%S)";
fallocate -l 10M $MOUNT_PATH/"$FROM_NODE"_"$WHEN".dump
ls -lha; echo;
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.
– JigglyNaga
Jan 19 '17 at 20:41
1
If you prefer sir:fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
add a comment |
FROM_NODE=N01;
echo; cd $MOUNT_PATH; pwd; ls -la; sleep 1; echo;
WHEN="$(date +%Y-%m-%d_%H-%M-%S)";
fallocate -l 10M $MOUNT_PATH/"$FROM_NODE"_"$WHEN".dump
ls -lha; echo;
FROM_NODE=N01;
echo; cd $MOUNT_PATH; pwd; ls -la; sleep 1; echo;
WHEN="$(date +%Y-%m-%d_%H-%M-%S)";
fallocate -l 10M $MOUNT_PATH/"$FROM_NODE"_"$WHEN".dump
ls -lha; echo;
answered Jan 19 '17 at 19:52
Pascal AndyPascal Andy
285
285
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.
– JigglyNaga
Jan 19 '17 at 20:41
1
If you prefer sir:fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
add a comment |
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.
– JigglyNaga
Jan 19 '17 at 20:41
1
If you prefer sir:fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
1
1
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
Doesn't this say 10 megs while the Q asks for 24?
– Jeff Schaller♦
Jan 19 '17 at 20:10
2
2
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.– JigglyNaga
Jan 19 '17 at 20:41
fallocate
could be a good answer, but why all the other lines? Cut your answer down so that it does just what was asked, and nothing more.– JigglyNaga
Jan 19 '17 at 20:41
1
1
If you prefer sir:
fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
If you prefer sir:
fallocate -l 10M somefile.dump
– Pascal Andy
Feb 5 '17 at 18:05
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f101332%2fgenerate-file-of-a-certain-size%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
-bash, command-line, files
2
stackoverflow.com/questions/139261/…
– ire_and_curses
Nov 15 '13 at 20:01
We will all assume you do not care what the content is so filled with zeroes will be fine.
– Bgs
Nov 15 '13 at 20:12