Learn how to create an empty file with a DOS command line in Windows.
In every directory, different files exist - NUL that is equivalent to /dev/null in UNIX.
There are multiple ways to create an empty file in the Windows command line.
one using the type
command with the pipe redirection
operator
type NUL > empty1.txt
It creates an empty1.txt file.
Another, using the cd
command with the pipe redirection
symbol.
cd . > empty2.txt
Third, use the call
command.
call > empty3.txt
The fourth way using the copy
command
copy > empty4.txt
The fifth way, using the echo
command.
echo. > empty5.txt
The sixth way is using Notepad on windows
notepad empty6.txt
It creates empty6.txt and opens the empty file in Notepad.
Seven ways are using the break command.
break > empty.txt
The above all are commands to create an empty file with zero bytes of size in a Windows dos command prompt.