tutorial on creating files for Mac Terminals

Source: Internet
Author: User

Of course there are a lot of ways users can create files when they use Macs, but sometimes it takes a terminal command to create a large, blank file, and it's really easy to create a large-capacity blank file in a Mac OS x system. Today we introduce two ways, the first is to use the terminal command line, the second is the use of disk tool application.

To create a bulk file using the terminal command line

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]

Use disk tool to wear large 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.

These are the tips for Mac OS X systems to create large-capacity blank files through 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.