The pico
command is a simple and user-friendly text editing program designed primarily for display-based operation, with the style of the pine
email composer. On modern Linux systems, nano
, the GNU version of pico
, is installed by default, and its usage is identical to that of pico
.
nano [OPTIONS] [[+LINE[,COLUMN]] FILE]...
+LINE[,COLUMN]
: Places the cursor at lineLINE
and columnCOLUMN
when starting up, rather than the default at line1
and column1
.-?
: Same as-h
.-A, --smarthome
: Makes theHome
key more intelligent; if pressed anywhere on a line other than at the very beginning of non-whitespace characters, the cursor will jump to that beginning (forward or backward); if the cursor is already there, it will jump to the true beginning of the line.-B, --backup
: When saving files, it backs up the previous version of the file to the current filename with a~
suffix.-C dir, --backupdir=dir
: Set the directory wherenano
places unique backup files if file backups are enabled.-D, --boldtext
: Uses bold text instead of reverse video text.-E, --tabstospaces
: Converts typed tabs to spaces.-F, --multibuffer
: Enables multiple file buffers if available.-H, --historylog
: Logs searches and replacements to~/.nano_history
from which, if there isnanorc
support, they can be retrieved in later sessions.-I, --ignorercfiles
: If there isnanorc
support, do not retrieveSYSCONFDIR/nanorc
or~/.nanorc
.-K, --rebindkeypad
: Interprets the keys of the numeric keypad so that they all work properly. This option is unnecessary unless needed, as enabling this option will prevent mouse support from functioning properly.-L, --nonewlines
: Does not add newlines at the end of the file.-N, --noconvert
: Disables automatic conversion fromDOS/Mac
format.-O, --morespace
: Uses the blank line below the title bar as extra editing space.-Q str, --quotestr=str
: Sets the quoting string used for justification. If there is extended regular expression support, the default value is^([ \t]*[#:>\|}])+
, otherwise it is>
. Please note that\t
representsTab
.-R, --restricted
: Restricts mode; does not read or write any files not specified on the command line, read anynanorc
files, allow suspending, allow appending a file to another name if there is a filename already, or save under another name, or use backup files or spell checking. Access can also be obtained by callingnano
with any name starting withr
(e.g.,rnano
).-S, --smooth
: Enables smooth scrolling; text will scroll line by line rather than the usual chunk-wise behavior.-T cols, --tabsize=cols
: Sets the size (width) of the tabs tocols
, wherecols
' value must be greater than0
; default value is8
.-U, --quickblank
: Quickly clears the status bar; after one keypress rather than 25 keypresses, the status bar message will disappear. Please note that-c
will override this content.-V, --version
: Outputs version information.-W, --wordbounds
: More accurately detects word boundaries by treating punctuation as part of the word.-Y str, --syntax=str
: Specifies a specific syntax to be highlighted from thenanorc
, if available.-c, --const
: Constantly display the cursor position. Please note that this will override-U
.-d, --rebinddelete
: Interprets theDelete
key differently so that both the backspace key and theDelete
key work properly; this option is only needed if the backspace key acts likeDelete
on the system.-h, --help
: Outputs help information.-i, --autoindent
: Indents new lines to the previous line's indentation, useful when editing source code.-k, --cut
: Enables cutting from the cursor to the end of the line.-l --nofollow
: If the file being edited is a symbolic link, it replaces that link with the new file instead of following it, perhaps useful when editing files in/tmp
.-m, --mouse
: Enables mouse support (if available for your system); mouse double-click can be used for marking when setting shortcuts, the mouse will work in theX
window system and on the console when runninggpm
.-o dir, --operatingdir=dir
: Sets the operating directory, makingnano
behave similar tochroot
.-p, --preserve
: Preserves theXON
andXOFF
sequences^Q
and^S
so that they are captured by the terminal.-r cols, --fill=cols
: Wraps at columncols
; if this value is equal to or less than0
, wrapping will take placecols
columns from the width of the screen; wrapping point will change with the width of the screen if it is adjusted, default value is-8
.-s prog, --speller=prog
: Enables an alternate spell-check program command.-t, --tempfile
: Always saves the modified buffer without prompting, same as thePico
-t
option.-v, --view
: View file (read-only) mode.-w, --nowrap
: Disables line wrapping for long lines.-x, --nohelp
: Disables the help screen at the bottom of the editor.-z, --suspend
: Enables the suspend feature.-a, -b, -e, -f, -g, -j
: Ignored for compatibility withPico
.
Edit a file using nano
, and edit the file according to the prompts.
nano file.txt
^G Get Help
^O WriteOut
^R Read File
^Y Prev Page
^K Cut Text
^C Cur Pos
^X Exit
^J Justify
^W Where Is
^V Next Page
^U UnCut Text
^T To Spell
https://github.com/WindrunnerMax/EveryDay
https://www.runoob.com/linux/linux-comm-pico.html
https://www.tutorialspoint.com/unix_commands/nano.htm
https://www.geeksforgeeks.org/nano-text-editor-in-linux/