Mac command line terminal How to create a file Mac command line terminal Create a file tutorial

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.