How Do I Create Text File In Windows, Mac, & Linux:

Do you want to create a text file in Windows, Mac, or Linux? Text files are essential and helpful for all kinds of things. Jot down a quick note, save information, and maintain a log or journal are just some things you should do using text files.

Today we’ll explain to you how to instantly create a new, blank text file in Mac, Windows, and Linux. In Windows, it’s quite easy. But on Linux or Mac, it needs some initial setup, then creating a new text file is instant and easy.

How Do I Create Text File In Windows, Mac, & Linux:

Create Text File In Windows Windows

Create Text File In Windows

Follow the steps to create a text file in Windows:

  • Microsoft provides an efficient way of creating a new, blank text file. All you need to do is to right-tap the menu in File Explorer.
  • Head over to File Explorer and navigate to the folder where you like to create the text file. Right-tap in the folder and move to New > Text Document.
  • The text file provides a default name, New Text Document.txt, but the name of the file is highlighted. Input a new name for the file and then hit Enter or just hit Enter to accept the default name.

Mac

There is no built-in that is quite equivalent to Windows’ New > Text Document option on the Mac. But after we can create a one-tap option in Finder with the help of the built-in Automator application.

Text File In Mac

Another alternative is to use an easy command in a Terminal window.

How To Use Automator App To Create Text File In Any Folder On Mac

Automator is a very essential and helpful automation tool in macOS. Come let’s take a look at how to use it to add an option for creating a new text file in Finder.

  • All you need to do is to launch Automator from the Applications folder. From the dialog box that shows. Just select a location for the application you like to create. You can also save it in the Applications folder. But if you would rather not save it there, you can also select another location. Just ensure it’s a permanent location.
  • When you’re in the selected location, tap New Document.
  • Automator asks you what type of doc you like to create. Tap Application in the Choose a type for your document box. Then, tap Choose.
  • Also, keep in mind that the Actions tab is selected from the left pane, and the Library is chosen in the pane. Move down in the list of actions and then drag the Run AppleScript action to the workflow pane.
  • Remove the text currently in the Run AppleScript box. Then copy the required line and paste it in the Run AppleScript box.

tell application “Finder” to make new file at (the target of the front window) as alias

  • Then move to File > Save.
  • Input a name for the application in the Save As box, keeping the “.app” extension.
  • Remember that the Application is chosen for File Format. As it becomes your default option. Then, tap Save.
  • We have now created our Automator app, we’re now going to add it to the Finder toolbar.
  • Head over to Finder and move the folder where you stored the Automator app.
  • Then hold down the Option and Cmd keys and then drag the application file to the toolbar.
  • If you want to use your new application to create a document text file, head over to the folder where you like to save the file and then tap the Automator button on the toolbar.
  • A text file known as “untitled” is created in the folder.
  • This technique of creating a blank, text file can’t put the “.txt” file extension on the file. If you’re trying to transfer that file to a Windows machine. Then you have to add the “.txt” file extension to the file. It’s difficult to work with files that don’t have extensions in Windows.
  • If you like to put the “.txt” file extension and modify the file name if you want, right-tap on the text file. Then, choose Rename and input a new name for the file. Then don’t forget to type: .txt at the last of the file name.
  • Tap Add when the following dialog box appears.
  • Double-tap the new text file to open it in the default text editor, then add content to it and successfully save it.
How To Use Terminal to Create Text File In Any Folder On Mac:

Also, you use the Terminal to make a new, blank text file.

  • The simplest way is to open Finder and choose the folder where you like to save the text file. Head over to Finder > Services > New Terminal at Folder.
  • Well, a Terminal window opens to the chosen folder. Input the following command at the prompt, replacing “MyTextFile.txt” with the name you like to use for your text doc.
touch MyTextFile.txt
  • The file is successfully created and stored in your selected folder. You can double-tap on the file to open it in your text editor, add content, and successfully save it.

Linux

Linux

In Linux, you can also use the command line to create a new, blank text doc file, in the same way as you do on Mac. If you want to use Nautilus to deal with files, you can instantly create text files there also.

How To Use Command Line To Create Text File Document On Linux
  • If you like to use the command line to create a new, blank text file, hit Ctrl + Alt + T to open a Terminal window. Input the following command and hit Enter.
touch ~/Documents/TextFiles/MyTextFile.txt
  • Modify the path and the file name (~/Documents/TextFiles/MyTextFile.txt) to what you like to use. The shortcut is the tilde character (~) for your home directory. For instance, the complete path to my text file mentioned above is /home/lori/Documents/TextFiles/MyTextFile.txt.

This workaround works in any Linux distribution, but the shortcut key tilde to open a Terminal window quite different.

How To Add Text File Document Template to Nautilus In Ubuntu Linux

We’re going to explain to you how to add an option to Nautilus in Ubuntu to make a new text file. File managers in Linux other distributions, such as Fedora, Linux Mint, Red Hat, etc., might already have this type of choice. If not, you can also use the command line technique mentioned above.

Prior to Ubuntu 17.10, Nautilus provides a choice on the right-tap menu that lets you create a totally new, blank doc in the current folder. But that option was erased in 17.10 and 18.04. We’ll also display to you how to add the option back to Nautilus.

In your home directory, you’ll then view a folder known as Templates. Initially, it’s totally empty. Adding files to this folder lets you instantly create new files with the help of the right-tap menu in Nautilus.

You can also use the touch command we talked about in the earlier section to create a new blank document template file.

Hit Ctrl + Alt + T to open a Terminal window. Then, type the following command and press Enter.

touch ~/Templates/Empty\ Document

That’s completely a backslash and space between “Document” or “Empty”. If there’s a space in your location or file name, you have to add a backslash before it.

A new file is known as “Empty Document” is also added to your Template directory. You can also use another name for the template file but make sure to store it in the Templates directory.

If you’re not comfortable using the command line, you can then create an empty document template using gedit.

  1. Press the Windows key and input: gedit in the search box. Then, tap the Text Editor icon that shows.
  2. Tap Save without entering any text in the file.
  3. Head over to the Templates directory in your Home directory.
  4. Input a name, such as “Empty Document”, in the Name box, and then tap Save.
Use the New Empty Doc Template To Create a New Text File in Linux

After you’ve created an empty document template with the help of steps in the earlier section, you can now create a new text file in Nautilus.

  • Right-tap in any directory and move to New Document > Empty Document. The Empty Document option display whatever you named your template file, so the option might be different for you.

Conclusion:

Well, you can also use a text editor to create a new blank text file. But the methods mentioned above to create a text file in Windows, Mac, or Linux are quite handy if you create many text files. I hope you enjoy it. If you want to share any other method then let us know below!

Also Read:

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *