Article Contents
We can assist! In this guide, we’ll show you how to create large file on Windows, Mac and Linux in the easiest way possible. Do you need to send a Windows computer on your network a lot of large files? Large, empty files are often used to test disc access, development, quality assurance, data zeroing, and scripting.
Even though it’s not useful for most users, it’s easy enough that anyone can try it out, even if they don’t need it. Text files can be used for lots of different things. Text files can be used to make quick notes, store information, and keep a log or journal, among other things. In just a few seconds, you can make a fake file that is 100 MB, 1 GB, 1 TB, or any other size.
How to create large file on Windows
- Open an elevated command prompt.
- Type or copy-paste the following command:
fsutil file createnew
- Substitute the <filename> portion with the actual file name.
- Substitute <length> with the desired file size in BYTES.
- The following command will create the file winaero.bin with size of 4 kilobytes under the location c:\data.
fsutil file createnew c:\data\winaero.bin 4096
You can also go to the official Microsoft support site for more information about this issue.
How to create large file on Mac
- Open Terminal App.
- Move to the location where you want to create your file using cd (change directory command)
- Now use command mkfile <size>G your-file-name.ext ( example: mkfile 4G mymovie.mov => will create a movie file with name mymovie of size 4GB)
- Hit Enter, It will take some time to complete the process (depends on the file size)
- When the command completes the prompt should return and file would be created.
- mkfile command also works on other Unix based or Linux Operating Systems.
How to create large file on Linux
Files can be copied and changed with the dd command. It is most often used to make live Linux USB drives.
- Let’s say you want to make a 2 GB text file with the name testfile.img. What you can do is:
dd if=/dev/zero of=testfile.img bs=2G count=1
- Depending on the size of the file, the command will take some time to complete.
- Here, you made a file that is 2 GB in size and has a single block that is 2 G in size. The NULL characters (/dev/zero) are in the file.
Using the truncate command to create huge files
The truncate command changes the size of each FILE to the size you want it to be. If a FILE is bigger than it needs to be, extra data is lost. If a FILE is too short, it is stretched, and the extra space (called a “hole”) is read as 0 bytes.
- Let’s use the truncare command to create file of 2 GB in size.
truncate -s 2G testfile.img
- You will see no output from the above command, however, the resultant file can be seen using the ls command:
ls -lh testfile.img
FAQ
How do I create a 2GB file on a Mac?
Use the following general form to use the mkfile command: mkfile -n size[b|k|m|g] filename Using the above, use the following command to create a 2GB file called “TESTFILE” on the desktop: mkfile -n 2g ~/Desktop/TESTFILE The file is made right away and takes up the space on the disc that you want it to.
What is the fastest way to create a file in Linux?
- Make a text file called foo.txt that is empty: $ Go to foo.bar.
- On Linux, make a text file: $ cat > filename.txt.
- When using cat on Linux, add data and press CTRL+D to save the filename.txt.
- Run command in shell: $ echo “This is just a test” > data.txt.
How to create 10 MB file in Linux?
How to use the xfs mkfile command in Linux to create a file of a certain size? xfs mkfile makes a file or more than one file. By default, the file is padded with zeros. The default size is in bytes, but the k, b, m, or g suffixes can change it to kilobytes, blocks, megabytes, or gigabytes.
How to free up 40 GB on Windows 10?
Select Settings > System > Storage from the Start menu. Open Storage settings.
Choose Configure Storage Sense or run it now, and then choose when you want each type of temporary file to be deleted under Temporary Files. Note: If you’d rather delete files by hand, scroll down and click Clean now under Free up space now.