- Feb 29, 2016 Most advanced users will edit the hosts file from the Mac OS X Terminal using nano or vim, but for those who prefer to stay within the Mac OS GUI, you can also modify the Mac’s hosts file through TextEdit, or even a third party app like BBEdit or TextWrangler. This offers a more user friendly option compared to going through the command line.
- MacBook Pro 5,5, Mac OS X (10.6.6) Posted on Feb 11, 2011 11:49 PM. The shell command to open a file in TextEdit is open -e mytextfile.txt.
- In the TextEdit app on your Mac, choose File Open. Select the document, then click Open. If your document is stored in iCloud Drive, you can select TextEdit in the iCloud section of the sidebar, then double-click your document. See Use iCloud Drive to store documents. To see the default formatting of an HTML or RTF file, choose TextEdit.
We’ve all used TextEdit before and though it’s a nice text editor in its own right, almost every one of us prefers to use other software, including the ever-popular Microsoft Word, Apple’s own Pages, and NeoOffice. It’s under appreciated, which is why numerous Mac users are looking for ways to change their default text editors.
Although you can always choose to open your text documents by right-clicking and picking the Open With option, there are people who want to save up fingertip stamina by merely double-clicking the selected text files. Fortunately, there are several ways you can change the default text editor on a Mac.
Using Get Info
Most advanced users will edit the hosts file from the Mac OS X Terminal using nano or vim, but for those who prefer to stay within the Mac OS GUI, you can also modify the Mac’s hosts file through TextEdit, or even a third party app like BBEdit or TextWrangler. This offers a more user friendly option compared to going through the command line. Step 2: To open the Hosts file, type the following command: sudo nano /etc/hosts. Notice the spacing in between the words. Edit hosts file on Mac using Nano Editor. Step 3: If the command line above is typed in correctly, Terminal would ask for the Admin password. Step 4: Hosts file is now open on the Nano text editor.
Let’s say you have a document you’re editing for the long-term and it will stay for days on one of your folders. Given that when you open it, the Mac’s default settings will always lead to it opening on TextEdit. To change this, one of the ways to do this is to resort to change the default text editor by accessing the Get Info menu. Here’s how to do it:
- First, right-click on the document and a drop down menu will appear.
- Select Get Info.
- After the menu appears there’s a drop down box labeled Open with. Select your preferred text editor from the list. Note that the drop down box may not hold certain word processing programs currently installed on your computer.
You can also use this method to set particular file extensions to open at a program of your choosing.
To do this, simply follow these steps:
- First, right click on the selected file.
- Open the Get Info option.
- Instead of choosing a program from the drop down box, click on Other.
- Pick a program from Finder and once you picked the appropriate one, select it.
- Below the drop down box, a Change All button will appear.
- Click on the said button and a dialogue box – as shown in the picture above – will appear. Click on Continue to open all files with a .docx extension.
You can repeat this for other file types as necessary, particularly on RTF, doc, and txt.
Using the Terminal
Although the above mentioned method is the easiest way you can change your default text editors, you can go take the long way out by using the Mac’s Terminal. Simply go over this Stack Exchange thread to get a clear idea on how to do it.
However, we really don’t recommend using the Terminal for this, given that it’s utterly complicated and you might make a mistake in editing your configuration files. It’s also pretty technical and anyone without proper programming experience would not understand how to do all of it.
Although TextEdit is undoubtedly useful (but only for limited functions), its not a go-to solution for all your word processing tasks. There are several other apps and programs, like MS Word, Open Office, and Sublime Text 2 that can cater to your work-related needs.
To save precious seconds, simply follow the above mentioned procedures and you will find yourself able to open your preferred word processors with a couple of clicks.
The text file (.TXT) contains unformatted text with the .txt file extension (for example, macreports.txt). By unformatted formatting, this type of text file is a plain text file without any formatting and styling, for example, these documents do not contain bold text, italic text, images, colors, different font types, hyperlinks, tables, bulleted lists, etc but these documents contain clear text. You can create, open, and edit a TXT file on your Mac using a text editor. An example of a text editor is TextEdit, which is included with macOS.
Contents
- 1 Text file on Mac
Text file on Mac
A text file is one of the simplest file types you can create on a computer. It can be opened by many different programs and does not include any special formatting, fonts, images, or other embedded data. You can create one with any OS for desktop, laptop or smartphone on the market.
Still, there are differences between text files. Files can contain different character encodings, which indicate how other characters and symbols, such as emoji, are translated into numerical systems that computers use to store data. Common notations in the United States include ASCII and Unicode, but other notations are used elsewhere in different languages.
Most Mac text processing software and other tools can automatically detect file encryption, but if you use the wrong encoding, the file may be completely or partially illegible.
1. Using TextEdit
TextEdit is a very known and popular application that can be used to create and edit text files on every Mac. It is included with all versions of macOS and OS X. Follow the given steps to open and use TextEdit and create a text file on Mac
- TextEdit is a word editing and word processing tool that comes with your Mac, start the process by opening the TextEdit app on your Mac (Applications> TextEdit, or use Spotlight, press Command-Space bar, to search, and search for TextEdit).
- In the TextEdit application, choose File> Open. TextEdit has two formatting modes: (a) plain text (.txt file) and (b) rich text (.rtf file). The difference is that .txt mode will not allow formatting, while .rtf mode allows you to format such as adding images, colors, tables, etc.
- The default format is Rich Text Format. You can change this by going to TextEdit> Preferences and selecting Plain Text.
- You can also change the mode while editing your text by going to Format> Create Plain Text or Format> Create Rich Text. If you change the .rtf (rich text) file to a .txt (plain text) file, your document will lose all formatting options.
- Create and edit your text file
- Then go to File> Save to save your text file.
- Name your file and save it.
You can also create richer documents, and you can use iCloud pages or pages or similar apps. Another note is that text files are also known as flat files or ASCII files.
Wifi Texting On Pc
2. Create a file from the terminal application
If you are not afraid to be more technical, you can use the terminal application to create files.
Since the goal of creating a file after browsing to the folder in the Finder app, we start by enabling the Terminal app for the current Finder folder.
Here are the steps to enable Terminal:
- Open System Preferences either from LaunchPad or from Spotlight Search.
- To launch it from Spotlight Search, press Command-Space to bring it in. In the search bar, type System Preferences (autocomplete will complete so you don’t need to type the entire word).
- In System, click Keyboard Icon Preferences.
- Click the Shortcuts tab.
- In the right pane of the box, click Services.
- Search for “New Workstation in Folder” under the “Files and Folders” section.
- Make sure the checkbox is selected.
- Close the window.
- Now browse to the folder you need.
- Right-click the folder and the context menu will include the Services option at the bottom will appear. This option includes different commands available for the current folder. Click “New Station in Folder”, the option that we just enabled in System Preferences.
- A new terminal window opens with the current folder set to the folder you selected in the Finder application.
- In Terminal type: Touch
For example, if I wanted to create a new text file on Mac called MyTextFile.txt, I would type: Touch MyTextFile.txt
You should see a new file appear in the Finder, now you can right-click the file and either click Open which will open the file using the TextEdit application or select the Open With option. If you have some text editors like Atom or Microsoft Word, you can choose one using the Open With option.
3. Create Txt File on Mac using third party software
The problem of adding new files seems very common, and I don’t understand why Apple is reluctant to add the option to create new files to the right-click menu. And you know that many people are annoyed by this situation because there are many commercial applications created for the sole purpose of solving the problem.
One of them is a free tool called “New File List”. To install it, do the following:
- Start the App Store
- Type a new file list for free in the search bar
- In the search results, find the New File Menu app and click Get
- After installation, MacOS will request the extension
- Click the Open System Preferences button
- In the system, preferences enable a checkbox called Finder Extensions in the NewMenuFileFree section
The disadvantage of the free version of the app is that it only allows the creation of one type of file. If you’re mostly creating Word files, you can choose a Word document from templates, but in this case, you won’t be able to create text files from the context menu. The good news is that if you need more templates than you can install the paid version of the app.
Conclusion
Open A File From Terminal
There are many ways to add and create text (.TXT) files to your Mac. We have reviewed only 3 of them, but any solution should be sufficient and not difficult to implement.