How to create an empty or blank file
Question
How to create an empty or blank file.
Answer
MS-DOS and Windows command line users
Linux and Unix
users
Windows users
MS-DOS and Windows command line users
Use the copy con command to create an empty file as shown below. The ^Z represents pressing Ctrl + Z on the keyboard once at a blank link. After pressing this shortcut you should get a 1 file copied message.
copy con file.txt
^Z
Use the touch command, as shown below to create an empty file. In the below example, the file "myexample" is created.
touch myexample
Tip: In order to create a empty file (0 bytes) it must be a txt or plaintext file. Other types of document files such as a blank .doc word processor file or blank Excel file cannot be created because these files contain extra data that make up the file, even if you haven't typed anything into the document.
From within Windows right-click in the area you wish to create the file. For example, right click on the Desktop to create a new text file on the Desktop. From the drop-down menu that appears New and then choose Text Document.
Additional information
- See the empty definition for additional information and related links.
