nano is a character terminal text editor, a bit like the editor program under DOS. It is much simpler than vi / vim, more suitable for Linux beginners. Some Linux distributions default editor is nano.
nano command to open the specified file for editing, by default it will automatically break the line, automatically split into several lines ie input is too long in a row, but in this way to deal with some files may cause problems, For example, the Linux system configuration files, automatic line break will only write the original content on one line broken into multiple lines, and may cause the system not working. So, if you want to avoid this situation, coupled with the -w option on it.
grammar:
nano [options] [[+ row, column] filename] ...
Options:
-h, -? | --help | This message is displayed |
+ Row, column | From the beginning the number of columns and rows within the meaning of | |
-A | --smarthome | Enable Smart HOME key |
-B | --backup | Backup existing file storage |
-C <directory> | --backupdir = <directory> | Directory for storing backup files only |
-D | --boldtext | Alternatively bold color inversion |
-E | --tabstospaces | Which has been input is converted to blank tabs |
-F | --multibuffer | Enable multiple file buffer function |
-H | --historylog | Log & read search / replace string history |
-I | --ignorercfiles | Do not file reference nanorc |
-K | --rebindkeypad | Correction numeric keypad keys confuse the issue |
-L | --nonewlines | Do not wrap to the file end |
-N | --noconvert | Do not switch from DOS / Mac format |
-O | --morespace | Use one more line editor |
-Q <string> | --quotestr = <string> | Reference represents a string |
-R | --restricted | Restricted mode |
-S | --smooth | Scroll by line instead of half screen |
-T <# number of columns> | --tabsize = <# Sequence> | Tab width setting column number # |
-U | --quickblank | Fast flashing status line |
-V | --version | Display version information and exit |
-W | --wordbounds | More accurately detect word boundaries |
-Y <string> | --syntax = <string> | Used to define the syntax highlighted |
-c | --const | Continuous display cursor position |
-d | --rebinddelete | Correction backspace / delete key confuse the issue |
-i | --autoindent | Auto-indenting new lines |
-k | -cut | Cut from the cursor to the end of the line |
-l | --nofollow | Do not follow symbolic links, but covers |
-m | --mouse | Enable mouse function |
-o <catalog> | --operatingdir = <directory> | Setting operation directory |
-p | --preserve | Reserved XON (^ Q) and XOFF (^ S) button |
-q | --quiet | Silence ignore startup issues like rc file errors |
-r <# number of columns> | --fill = <# Sequence> | Set wrapping row number # |
-s <program> | --speller = <program> | Enable alternative spell checker |
-t | --tempfile | Auto save on exit, do not prompt |
-u | --undo | General allowed to revoke [experimental properties] |
-v | --view | View (read-only) mode |
-w | --nowrap | Do not wrap |
-x | --nohelp | Do not show auxiliary area |
-with | --suspend | Enable pause function |
-$ | --softwrap | Enable soft line break |
-a, -b, -e, | ||
-f, -g, -j | (Ignored for compatibility with pico) |
usage:
Cursor control:
- Move cursor: using the directional keys to move.
- Select text: Hold down the left mouse button and drag.
Copy, cut and paste, and paste:
- Copy an entire row: Alt + 6
- Cut and paste an entire row: Ctrl + K
Paste: Ctrl + U:
If desired cut / paste or a portion of a plurality of rows in a row, first cursor to the beginning need to copy / cut and paste text, press Ctrl + 6 (or Alt + A) mark, and then move the cursor to be cut / paste text end. Then the selected text will be highlighted, with Alt + 6 to copy, Ctrl + K to cut and paste. If in the process of selecting the text you want to cancel, just press Ctrl + 6.
search for:
Press Ctrl + W, then enter the keywords you want to search, enter OK. This will locate the first matching text, may then be used to locate Alt + W to the next matching text.
Page:
- Previous to Ctrl + Y
- Ctrl + V to the next
Storage:
Use Ctrl + O to save your changes
drop out:
Press Ctrl + X
如果你修改了文件,下面会询问你是否需要保存修改。输入Y确认保存,输入N不保存,按Ctrl+C取消返回。如果输入了Y,下一步会让你输入想要保存的文件名。如果不需要修改文件名直接回车就行;若想要保存成别的名字(也就是另存为)则输入新名称然后确 定。这个时候也可用Ctrl+C来取消返回。