← All commands
Topic hub File Management
Windows Linux File Management Expanded guide File System

Windows fsutil file createnew equivalent in Linux

Creates an empty or preallocated file with a specific size.

Windows fsutil file createnew
→
Linux equivalents
Debian/Ubuntu same command
truncate -s 100M test.img
Fedora same command
truncate -s 100M test.img
Arch same command
truncate -s 100M test.img

Overview

What this command does

On Windows, "fsutil file createnew" is used to create a file of a chosen size. On Linux, the closest practical mapping shown here is "truncate -s 100M test.img". Creates an empty or preallocated file with a specific size. This reference is grouped under File Management → File System.

Migration tip: <code>truncate</code> changes the apparent file size. <code>fallocate</code> reserves real disk blocks and is better for testing storage allocation.

Windows → Linux context

What changes when you use this on Linux?

Equivalent task, different tool

Windows fsutil file createnew maps to truncate -s 100M test.img for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.

Portable across the compared distros

The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.

Command-specific caution

Sparse files can appear large while consuming little disk space. Use du -h and ls -lh together to compare allocated and apparent size.

Practical tasks

Common use cases

Create a file of a chosen size

Creates an empty or preallocated file with a specific size.

truncate -s 100M test.img

Create a sparse 100 MB file

fallocate -l 1G disk.img

Allocate a real 1 GB file

truncate -s 0 logfile.txt

Empty a file without deleting it

Ready to run

Copyable Linux commands

Review paths, device names, package names and permissions before running any command.

truncate -s 100M test.img
fallocate -l 1G disk.img
truncate -s 0 logfile.txt

Walkthrough

Examples with explanations

truncate -s 100M test.img # create a sparse 100 MB file
fallocate -l 1G disk.img # allocate 1 GB of disk space
truncate -s 0 logfile.txt # clear a file while keeping it

Reference

Common options and variations

Command or optionUse
truncate -s 100M test.imgCreate a sparse 100 MB file
fallocate -l 1G disk.imgAllocate a real 1 GB file
truncate -s 0 logfile.txtEmpty a file without deleting it

Distro differences

Debian/Ubuntu vs Fedora vs Arch

Debian/Ubuntu, Fedora and Arch all use "truncate -s 100M test.img" for this mapping. The command syntax shown here is portable across the three rows, although installed versions and system defaults can still vary.

DistributionPackage manager / baseEquivalent commandDifference to notice
Debian/Ubuntu same command truncate -s 100M test.img Same command on this distribution.
Fedora same command truncate -s 100M test.img Same command on this distribution.
Arch same command truncate -s 100M test.img Same command on this distribution.

Important

What to watch out for

Sparse files can appear large while consuming little disk space. Use du -h and ls -lh together to compare allocated and apparent size.

Keep learning

Related File Management commands