nano (text editor) Linux command of

nano

Character terminal text editor

Supplement

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, you add -woptions bar.

grammar

nano [选项] [[+行,列] 文件名]...

Options

 -h, -?         --help                  显示此信息
 +行,列                                 从所指列数与行数开始
 -A             --smarthome             启用智能 HOME 键
 -B             --backup                储存既有文件的备份
 -C <目录>      --backupdir=<目录>      用以储存独一备份文件的目录
 -D             --boldtext              用粗体替代颜色反转
 -E             --tabstospaces          将已输入的制表符转换为空白
 -F             --multibuffer           启用多重文件缓冲区功能
 -H             --historylog            记录与读取搜索/替换的历史字符串
 -I             --ignorercfiles         不要参考nanorc 文件
 -K             --rebindkeypad          修正数字键区按键混淆问题
 -L             --nonewlines            不要将换行加到文件末端
 -N             --noconvert             不要从 DOS/Mac 格式转换
 -O             --morespace             编辑时多使用一行
 -Q <字符串>    --quotestr=<字符串>     引用代表字符串
 -R             --restricted            限制模式
 -S             --smooth                按行滚动而不是半屏
 -T <#列数>     --tabsize=<#列数>       设定制表符宽度为 #列数
 -U             --quickblank            状态行快速闪动
 -V             --version               显示版本资讯并离开
 -W             --wordbounds            更正确地侦测单字边界
 -Y <字符串>    --syntax=<字符串>       用于加亮的语法定义
 -c             --const                 持续显示游标位置
 -d             --rebinddelete          修正退格键/删除键混淆问题
 -i             --autoindent            自动缩进新行
 -k             --cut                   从游标剪切至行尾
 -l             --nofollow              不要依照符号连结,而是覆盖
 -m             --mouse                 启用鼠标功能
 -o <目录>      --operatingdir=<目录>   设定操作目录
 -p             --preserve              保留XON (^Q) 和XOFF (^S) 按键
 -q             --quiet                 沉默忽略启动问题, 比如rc 文件错误
 -r <#列数>     --fill=<#列数>          设定折行宽度为 #列数
 -s <程序> --speller=<程序> 启用替代的拼写检查程序 -t --tempfile 离开时自动储存,不要提示 -u --undo 允许通用撤销[试验性特性] -v --view 查看(只读)模式 -w --nowrap 不要自动换行 -x --nohelp 不要显示辅助区 -z --suspend 启用暂停功能 -$ --softwrap 启用软换行 -a, -b, -e, -f, -g, -j (忽略,为与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.

Next page

  • Previous to Ctrl + Y
  • Ctrl + V to the next

    Storage

Use Ctrl + O to save your changes

drop out

Press Ctrl + X

If you modify a file, the following will be asked whether you want to save the changes. Enter Y to confirm saved, not saved N input, cancel return press Ctrl + C. If you enter Y, the next step will let you enter the file name you want to save. If you do not change the file name directly to Enter on the line; if you want to save as another name (that is, save as) then enter the new name and then OK. This time can also be used Ctrl + C to cancel the return

Transfer: https://ipcmen.com/nano

Guess you like

Origin www.cnblogs.com/wx170119/p/12084397.html