Apple Mac OS X tips and tweaks
Share this page with your friends! Tweet
Create and edit text files with Nano
Every operating system is different of course, but if you had to say which one the Apple Mac's OS X is most like, you would have to say Unix or Linux. OS X, Unix and Linux are all part of the same operating system family and they are all related to each other. Underneath the Mac's interface is a very Linux-like system and some of the tools and techniques that Unix and Linux people use can also be used on the Mac. Take Nano, for example. It's a text editor that can be used to create and edit text files. Although you would naturally fire up TextEdit on the Mac if you wanted to create a text file, Nano is different and in some circumstances it might be prefereable. Here's a quick guide to using Nano on your Mac.
Nano is actually a free version of a text editor called Pico and Pico was part of Pine, a Program for Internet News and Email. It does not have a graphical user interface and it is run from the command line. To use it you must therefore open a Terminal window. Go to the Applications folder, then open Utilities and run Terminal. You can type either nano or pico to start the nano editor and you'll see a mainly blank screen with a title bar at the top and a two-line help panel at the bottom.
The bottom panel shows the most common commands that you need and the ^ symbol means hold down the Ctrl (Control) key. So to get help, for example, you press Ctrl+G. Press it and see. Scroll up and down through the help file by using the cursor keys and when you have finished, press Ctrl+X, which exits back to the initial page. Pressing Ctrl+X again would quit the Nano editor, but let's create a text file first.
You'll see the cursor near the top of the window and you can type in text just as you would with any text editor or word processor. Use the cursor keys to move around, press Ctrl+space to jumo forward one word at a time and press Esc (Escape) and then press space to jump back one word at a time. Ctrl+V jumps down a page and Ctrl+Y jumps up a page.
After entering some text, we'll save it to a new file (since we haven't changed folders at any time, it will be created in your home folder). Press Ctrl+O to write Out the file to disk. Notice that the help bar at the foot of the window changes. We want to save the fie in Mac format, so press the Esc (Escape) key and then press M (that's what the M- means in the help bar). You'll see that it prompts for a filename and it says that the format is now Mac Format. Enter a name like myfile.txt and press enter. The file is saved and you can press Ctrl+X to eXit.
Loading files for editing is easy and you just type something like
Check out the help file for more information on this hidden utility buried deep within the Mac's OS.
Go to Apple Mac and OS X tips and tweaks index...