Computing.Net > Forums > Unix > creating file of arbitrary size

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

creating file of arbitrary size

Reply to Message Icon

Name: cweng
Date: July 17, 2003 at 17:06:14 Pacific
OS: linux
CPU/Ram: Intel x86
Comment:

Hello what is the unix command to create a binary file of arbitrary size ? I used it before but I forgot the command name. Pls send your reply to my email address chicheongweng@yahoo.com also




Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: July 18, 2003 at 02:19:31 Pacific
Reply:

Binary file? No idea. If you need to create a file for swap on solaris - mkfile.

DESCRIPTION

mkfile creates one or more files that are suitable for use as NFS-mounted swap areas, or as local swap areas. When a root user executes mkfile(), the sticky bit is set and the file is padded with zeros by default. When non-root users execute mkfile(), they must manually set the sticky bit using chmod(1). The default size is in bytes, but it can be flagged as kilobytes, blocks, or megabytes, with the k, b, or m suffixes, respectively.


0

Response Number 2
Name: Ramsey Brenner
Date: July 19, 2003 at 17:50:11 Pacific
Reply:

Hi cweng,

Try:

cat /dev/urandom > filename (press ctrl-c
after a few seconds)

OR...

head -c [# bytes] /dev/urandom > filename


Im sure there are a few other ways also.

--
Ramsey Brenner
osdisc.com support


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: creating file of arbitrary size

to create a file of specified size www.computing.net/answers/unix/to-create-a-file-of-specified-size/6497.html

Idenifying files of size zero www.computing.net/answers/unix/idenifying-files-of-size-zero/3247.html

chmod after ftp a file www.computing.net/answers/unix/chmod-after-ftp-a-file/4575.html