2015-12-30 14:31:49 -05:00
|
|
|
# nano
|
|
|
|
|
2025-06-28 16:12:44 +03:00
|
|
|
> Text editor. An enhanced `pico` clone.
|
2025-06-25 22:27:18 -07:00
|
|
|
> See also: `pico`, `rnano`.
|
2025-06-27 06:08:56 +00:00
|
|
|
> More information: <https://nano-editor.org/dist/latest/nano.html>.
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2025-06-27 06:08:56 +00:00
|
|
|
- Open specific files, moving to the next file after closing the previous one:
|
2021-07-28 15:10:07 +01:00
|
|
|
|
2025-06-27 06:08:56 +00:00
|
|
|
`nano {{path/to/file1 path/to/file2 ...}}`
|
2021-07-28 15:10:07 +01:00
|
|
|
|
2023-01-08 18:07:06 +10:00
|
|
|
- Start the editor without using configuration files:
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`nano {{[-I|--ignorercfiles]}}`
|
2020-01-29 17:16:44 +02:00
|
|
|
|
2023-01-08 18:07:06 +10:00
|
|
|
- Open a file and position the cursor at a specific line and column:
|
2020-01-29 17:16:44 +02:00
|
|
|
|
|
|
|
`nano +{{line}},{{column}} {{path/to/file}}`
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2023-01-08 18:07:06 +10:00
|
|
|
- Open a file and enable soft wrapping:
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`nano {{[-S|--softwrap]}} {{path/to/file}}`
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2023-01-08 18:07:06 +10:00
|
|
|
- Open a file and indent new lines to the previous line's indentation:
|
2015-12-30 14:31:49 -05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`nano {{[-i|--autoindent]}} {{path/to/file}}`
|
2020-10-05 18:56:27 +05:00
|
|
|
|
2023-01-08 18:07:06 +10:00
|
|
|
- Open a file and create a backup file (`path/to/file~`) on save:
|
2020-10-05 18:56:27 +05:00
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
`nano {{[-B|--backup]}} {{path/to/file}}`
|
|
|
|
|
2025-06-27 06:08:56 +00:00
|
|
|
- Open a file in restricted mode (i.e. don't read/write to files not specified on the command-line):
|
|
|
|
|
|
|
|
`nano {{[-R|--restricted]}} {{path/to/file}}`
|
|
|
|
|
2025-03-12 21:05:58 +02:00
|
|
|
- Exit nano:
|
|
|
|
|
|
|
|
`<Ctrl x>`
|