How does a Mac command line terminal Create a file? It's really easy to create a large-capacity blank file in a Mac OS X system. This article small Lego for you to introduce two kinds of file creation tutorial, the first is to use the MAC command line terminal to create the file, the second is to use the disk tool application.
How does a Mac command line terminal create a file?
The simplest command to quickly generate large-capacity blank files is mkfile, which is supported by both large and small files. Mkfile The format of the Mkfile command is this
Mkfile-n Size[b|k|m|g] File name
For example, if you want to create a 1GB capacity file named "Bulk test File" on your desktop, you only need to use the following command
Mkfile-n 1g ~/desktop/Large-capacity test file
However, there is a shortage of mkfile commands, because this command only supports Mac OS X, and if you want to create large-capacity blank files on other platforms, the DD command is more appropriate, and the DD command supports all UNIX and Linux systems. Using the DD command, we need to define the filename, block size, and chunk size:
DD If=/dev/zero of=filename bs=1024 count=1000
If you want to create a file with a capacity of 100MB, you need the following command.
DD If=/dev/zero of=largetestfile.img bs=1024 count=0 seek=$[1024*100]
Using disk tools to create large-capacity blank files
1. Although users who want to use large-capacity blank files may prefer the terminal command line, disk utility applications can do the job well.
2. After opening the disk tool, click on the "file" drop-down menu in the upper left corner, select New, and select "Blank disk image".
3. Name the file that you want, and then choose the size you need in the size Drop-down menu, and click Create at the end.
That's the trick of the Mac OS X system to create large-capacity blank files via command line terminals or disk tools.