Sample Header Ad - 728x90

Using BSD jot for generating file with random content

2 votes
1 answer
384 views
Quote from Using BSD jot > Most every Linux system comes with GNU seq (a utility to generate > sequences of numbers or characters). However, a much older utility – > and more flexible one – is the underutilized and unknown utility, jot. > Every BSD system, including MacOS X, will come with jot (and not with > seq). (...) > In fact, to generate a large file (5Gb in this case), try this: > >
>jot -r -c -s '' $(( 1024 * 1024 * 5 )) > file.5gb
>
When I try this out it generates a 5 MB file.
-console
$ jot -r -c -s '' $(( 1024 * 1024 * 5 )) > file.5gb
$ du -sh file.5gb
5.0M    file.5gb
What does this command exactly do? How to specify size, for example 2 GB file? Is this the recommended way to generate random content files on macOS? Do you use other tools for random content files? seq can't generate random content. Is this correct?
Asked by Sybil (1983 rep)
Apr 2, 2017, 04:34 AM
Last activity: Aug 3, 2023, 10:00 AM