Skip to content

Commit b452588

Browse files
authored
Merge pull request linode#853 from linode/kcraig34-patch-32
Update and rename using-nano.md to Use-Nano-Text-Editor-Commands.md
2 parents 2436da1 + 26c1953 commit b452588

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/tools-reference/tools/using-nano.md renamed to docs/tools-reference/tools/Use-Nano-Text-Editor-Commands.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
author:
33
name: Linode
44
email: docs@linode.com
5-
description: 'Use nano to edit and create files on your Linode.'
5+
description: This tutorial will teach you how to install and use Nano text editor to create and edit files in Linux.
66
keywords: 'nano,editor'
77
license: '[CC BY-ND 4.0](https://creativecommons.org/licenses/by-nd/4.0)'
8-
alias: ['linux-tools/text-editors/nano/']
8+
alias: ['linux-tools/text-editors/nano/','tools-reference/tools/using-nano/']
99
modified: Tuesday, November 8th, 2011
1010
modified_by:
1111
name: Linode
1212
published: 'Tuesday, November 8th, 2011'
13-
title: Using Nano
13+
title: How to Use Nano Text Editor Commands in Linux
1414
---
1515

1616
GNU nano is a popular command line text editor used on many operating systems including Unix-based systems and BSD variants. It is a popular editor for users who may find `vi` or `emacs` commands to be non-intuitive.
1717

1818
![Using Nano](/docs/assets/using_nano_smg.png)
1919

20-
## Installing Nano
20+
## Nano Set Up and Basic Commands
2121

2222
Nano is included with many Linux distributions by default, but some users may need to install it through their distribution's [package management](/docs/using-linux/package-management/) tool:
2323

@@ -31,11 +31,11 @@ CentOS/Fedora users can issue the following command to install nano:
3131

3232
When using nano, control characters (CTRL) are represented by a carat (`^`). For example, if you wish to cut a line of text, you would use the "CTRL" key followed by the "K" key. This sequence of commands is represented as `^K` in nano. Some commands use the "Alt" key in order to function, which is represented by the letter "M". A command represented as `M-R` in nano would be performed by pressing the "Alt" key followed by the "R" key. Please note that Mac users may need to use the "Escape" (Esc) key instead of the "Alt" key to perform these commands.
3333

34-
## Creating and Opening Files
34+
## Create and Open Files
3535

3636
There are different ways to start nano depending on what type of file you wish to edit. Please read through the options below to determine which is best for you.
3737

38-
### Creating Files
38+
### Create Files
3939

4040
Nano can be used to create blank files that are then opened to be edited. To create a new file, issue a command similar to the following:
4141

@@ -45,7 +45,7 @@ In the command above, nano is used to create a file called `index.html` in the `
4545

4646
You do not need to provide an absolute path for the file you wish to create. If the file already exists, nano will simply open it instead of creating it. If you decide not to save the file after you edit it, no new files are created on the file system.
4747

48-
### Opening Text Files
48+
### Open Text Files
4949

5050
To edit a basic text file (e.g. that end with `.txt`), you can use `nano /path/to/file.txt` to open or create a text file in a specific location. If you wanted to open a file located at `~/mystuff/plan.txt`, you would issue the following command:
5151

@@ -61,21 +61,21 @@ To open a file as "read only," use the following form:
6161

6262
nano -v myfile
6363

64-
### Opening Configuration Files
64+
### Open Configuration Files
6565

6666
When editing files used to configure applications or system utilities, it is important that you start nano with `-w`.
6767

6868
nano -w /etc/mysql/my.cnf
6969

7070
Opening nano in this manner will prevent it from wrapping lines that are too long to fit on your screen, which can create problems if config directives are saved across multiple lines. `nano -w` is also useful for creating new files that you do not wish to word wrap.
7171

72-
## Editing Files
72+
## Edit Files
7373

74-
### Cutting and Pasting
74+
### Cut and Paste Lines of Text
7575

7676
To cut a line of text, use `^K`. To paste it back, simply move the cursor where you want the text to be placed and use `^U`. If you would like to cut multiple lines, use a series of `^K` commands until all lines you wish to cut have been removed. When you go to paste them back with `^U`, the lines will all be pasted at once.
7777

78-
### Searching
78+
### Search Text
7979

8080
To search for text in a document, use `^W`. When using this command, you will be presented with a number of options to assist you in your search.
8181

@@ -94,11 +94,11 @@ If you wish to search for text by using a regular expression, you may do so by e
9494

9595
To go to a line number, enter `^T` at the search prompt and enter the line number that you wish to navigate to.
9696

97-
#### Find and Replace
97+
#### Find and Replace Text
9898

9999
At the search menu, enter `^R`. You will be presented with two prompts. The first prompt will ask you to enter the text you wish to replace. Once you have done so, enter the test you wish to replace the previous text with.
100100

101-
### Spell Checking
101+
### Spell Check
102102

103103
Nano has a built in spell checking feature that relies on the `spell` package to function. To install this package, issue the appropriate command from below:
104104

@@ -112,15 +112,15 @@ CentOS/Fedora:
112112

113113
Once you have installed spell, you may use the spell checking feature by issuing `^T` while editing a file.
114114

115-
## Saving and Exiting
115+
## Save and Exit
116116

117117
When you're done editing your file, you can save it and exit the program.
118118

119-
### Saving
119+
### Save
120120

121121
To save your work, issue `^O` or "WriteOut". This will save the document and leave nano open for you to continue working.
122122

123-
### Saving with Backups
123+
### Save with Backups
124124

125125
Nano will allow you to create backups of files that you are editing when you exit. These backups can be placed in a directory that you choose, otherwise these backup files are placed in the same directory as the modified file.
126126

@@ -130,6 +130,6 @@ Using the `-B` option when starting nano will create backups of the file for you
130130

131131
The command listed above will create a backup copy of `index.php` in the `backups` folder in the current user's home directory.
132132

133-
### Exiting
133+
### Exit
134134

135135
Once you're ready to exit, issue `^X` to exit nano. If you have not saved your work, you will be prompted to save the changes or cancel the exit routine.

0 commit comments

Comments
 (0)