It was yesterday. The Nano was a suggested compiler and then found a good blog to learn. By the way.
Nano Command Guide
Today in the loss command, inadvertently entered the Nano, not too familiar with the command, the results do not know how to exit, save, quickly check the information, the original is such AH.
Code Listing 1.1: Opening or creating a new file |
#Nano file name |
The Nano is a single-mode editor that allows you to enter text directly. If you want to edit a configuration file like/etc/fstab, use the- w parameter, for example:
Code Listing 1.2: Disabling line Wrapping |
#Nano-w/etc/fstab |
Warning: This is very important. If you forget the-w parameter when you edit the configuration file , it may cause your system to fail to start or produce other exceptions. |
Save and exit
If you want to save your changes, press Ctrl+o. To exit, press CTRL +X. If you do not save your changes before exiting, it will prompt you whether you want to save. If not, press N, or vice versa, press Y. Then it will let you confirm the name of the file you want to save, confirm or modify and press ENTER. If you have not modified and accidentally pressed the save key, you can press CTRL +c to cancel when requesting confirmation of the file name.
Cut and paste
To cut an entire line, use CTRL+K (Hold down CTRL and press the K key). The line where the cursor is located disappears. To paste it, simply move the cursor to the location you want to paste, and then press Ctrl+u. To move multiple lines, just press the ctrl+k a few more times to cut down the content you need to move, and then press CTRL +u to paste all the content you just cut. If you want to use more precise cut control, you need to mark the text. Move the cursor to the beginning of the text you want to cut, and press CTRL+6(or alt+a). Then move the cursor to the end of the text you want to cut: The text that was marked is anti-white. To undo a text marker, simply press CTRL +6again. Use Ctrl+k to cut the tagged text and paste it with ctrl+u.
Search for specific text
When you want to search for a particular text, it's easy tothink of it as "whereis" rather than "search". Just press Ctrl+w, type the string you want to search for, and then press ENTER. To search for the same string again, you can press alt+w directly.
Note: In the Nano help document, Ctrl-key is represented as a caret (^), so Ctrl+w is written as ^w, and so on. The alt-key is represented as a m (from "Meta" ), so Alt+w is written as a m-w.
Help documentation for the Nano
Main Nano Help text the Nano editor isDesigned to emulate the functionality and ease-of-Use of the UW Pico text editor. There is four main sections of the editor. The top line shows the program version, the current filename being edited, and whether or not the file has been modified. Next isThe Main editor window showing the file being edited. The Status line isThe third line fromThe bottom and shows important messages. The bottom lines show the most commonly used shortcutsinchThe editor. The notation forShortcuts is asfollows:control-key sequences is notated with a caret (^) symbol and can be entered either byusingThe Control (Ctrl) key or pressing the Escape (ESC) key twice. Escape-key sequences is notated with the Meta (M-) symbol and can be enteredusingeither the ESC, ALT, or Meta key depending on your keyboard setup. Also, pressing ESC twice and then typing a three-digitdecimalNumber from theTo255Would enter the character with the corresponding value. The following keystrokes is availableinchThe Main editor window. Alternative keys are showninchparentheses:^g (F1) Display ThisHelp text^x (F2) Close the current file buffer/exit fromNano^O (F3) Write The current file to disk^J (F4) Justify the current paragraph^R (F5) Insert another file into the current one^w (F6) Search forAstringor a regular expression^Y (F7) Go to previous screen^V (F8) Go to next screen^k (F9) Cut the current line and store itinchThe cutbuffer^u (F10) Uncut fromThe Cutbuffer into the^C (F11) Display the position of the cursor^t (F12) Invoke the spell checker,ifAvailablem-\ (m-|) Go to the first line of the Filem-/(M-?) Go to the last line of the file^_ (F13) (M-G) Go to line and column number^\ (F14) (m-r) Replace Astringor a regular expression^^ (F15) (M-A) Mark text at the cursor positionm-W (F16) Repeat last Searchm-^ (M-6Copy the current line and store itinchThe cutbufferm-} Indent the current linem-{unindent the current line^F Go forward one character^B Go back one character^Space Go forward one WORDM-Space Go back one word^P Go to previous line^N Go to next line^A Go to beginning of the current line^E Go to end of current Linem-((M-9) Go to beginning of paragraph; Then of previous PARAGRAPHM-) (M-0) Go just beyond end of paragraph; Then of next PARAGRAPHM-] Go to the matching Bracketm-(M-_) Scroll up one line without scrolling the Cursorm-+ (m-=) Scroll down one line without scrolling the Cursorm-< (M-,) Switch to the previous file Bufferm-M.) Switch to the next file Bufferm-V Insert The next keystroke verbatim^I Insert A tab at the cursor position^M Insert A newline at the cursor position^D Delete The character under the cursor^H Delete The character to the Cursorm-T Cut fromThe cursor position to the end of the Filem-J Justify the entire Filem-D Count The number of words, lines, and characters^L Refresh (redraw) the current screen^z Suspend the editor (ifSuspend isenabled) (M-X) help mode enable/Disable (M-c) Constant cursor position display enable/Disable (M-O) Use of one + line forEditing enable/Disable (M-s) Smooth scrolling enable/Disable (M-p) whitespace display enable/Disable (M-y) Color syntax highlighting enable/Disable (M-h) Smart Home key enable/Disable (M-i) Auto indent enable/Disable (M-K) Cut to end enable/Disable (M-L) Long line wrapping enable/Disable (M-Q) Conversion of typed tabs to spaces enable/Disable (M-b) Backup files enable/Disable (M-f) Multiple file buffers enable/Disable (M-m) Mouse support enable/Disable (M-N) No conversion fromDos/mac format enable/Disable (M-Z) Suspension enable/Disable (M-$) Soft Line Wrapping enable/disable
· Ubuntu"nano command