Questions tagged [nano]

nano is a text editor from the GNU project; apply this tag if you are asking about features or functionality of the editor

Filter by
Sorted by
Tagged with
7 votes
4 answers
651 views

Save file changes if you forgot to use sudo [duplicate]

I am using Nano. Sometimes I make changes to a file and then after attempting to save I realize that I need sudo permissions. Then I need to close the file, reopen it as sudo and make my changes again....
user avatar
  • 1,708
0 votes
1 answer
66 views

What are the weird characters from an image file?

So i am pretty new to linux and i am learning basic commands. I am also very interested to know how things work under the hood, so sometime after i learned both the cat and nano commands, i tried ...
user avatar
  • 13
0 votes
1 answer
25 views

Is it possible to easily switch between tabs and spaces in nano on MAC?

Is it possible to easily switch between tabs and spaces in nano on MAC. I have seen here how to do that but this doesn't work, maybe because I am working with a mac machine
user avatar
0 votes
0 answers
32 views

xargs nano leads to Received SIGHUP or SIGTERM while xargs less is OK

Scenario: $ cat t0.txt t1.txt $ cat t1.txt xxx $ sed -n 1p t0.txt | xargs less # OK $ sed -n 1p t0.txt | xargs nano Received SIGHUP or SIGTERM dvl-linux64 $ nano --version GNU nano, version 2.5.3 ...
user avatar
  • 355
0 votes
0 answers
49 views

nano: copy&paste multiple lines from clipboard removes new lines

I experience some annoying behaviour when copy&paste multiple lines into nano. When copying (Shift+Ctrl+c) the lines in the bash in the top plot and pasting into a nano file (ShiftCtrl+v, bottom ...
user avatar
0 votes
1 answer
81 views

I need to run ~$ sudo nano in order write and save a file and can't do so with just the nano command. How do I change this?

To make the question better understood -> I currently have to run nano with sudo when i just want to run nano to edit a file. So while I was fiddling with Ubuntu 20.04 in a VM I had everything more ...
user avatar
  • 3
0 votes
0 answers
30 views

Export nano's syntax highlighting

I like how nano highlights bash scripts and I often use GNOME terminal's "Copy as HTML" option to copy/paste the color highlights to LibreOffice when writing documentation. That works fine ...
user avatar
  • 196
0 votes
1 answer
181 views

Sorting lines in nano?

Is it possible to sort a selected area of text alphabetically using the nano editor? ( similar to the F10 in xed ) I use Linux Mint 20 , nano 4.8 Thank you
user avatar
1 vote
1 answer
88 views

Syntax highlighting combinations of strings and comments in nano

I was wondering if anyone could tell me if it possible to configure syntax highlighting in .nanorc so that in the following text ... Dim s$ = "foo ' bar" ' bar "foo" ... the ...
user avatar
0 votes
0 answers
26 views

Jump to line in nano

When using nano in any of several terminal emulators Ctrl + / invokes Enter line number, column number: dialog. However when working from a virtual terminal e.g. Ctrl + Alt + F4 nothing happens. Why?
user avatar
  • 2,643
0 votes
1 answer
38 views

Tmux changes to default preinstalled nano version instead of newly installed homebrew one

When i use nano in the terminal without enabling tmux, it shows the path for the brew version nano is an alias for /opt/homebrew/Cellar/nano However when i use tmux, type nano shows the same path but ...
user avatar
0 votes
0 answers
14 views

Bind a key to a series of actions for Nano

I have an extremely common task: pick asdf1234 Comment on this commit With text like this, I want to turn the first word into f like: f asdf1234 Comment on this commit Now I have learned that I can ...
user avatar
  • 101
0 votes
3 answers
112 views

How to combine the commands "find" and "nano"

How can I combine the "find" command with the "nano" command? For example, find . -name "helloworld.py" | nano How to open that file (first out of several lets say) ...
user avatar
3 votes
5 answers
598 views

How to search for Debian CLI packages?

I recently installed Debian for CLI purposes. I am looking to install CLI packages, I want to know how to search for packages (CLI packages such as nano)?
user avatar
3 votes
1 answer
153 views

Synology ipkg nano - line numbers are wrong, and sometimes appear on the wrong side of the file

update I submitted a bug report and the conclusion is that the nano version that's available through ipkg is 3 years outdated, and has been incorrectly modified or a dependency is broken. ...
user avatar
  • 131
2 votes
1 answer
245 views

Which linters are supported by nano?

In my latex.nanorc file, I have the following instructions: syntax "LaTeX" "\.(la)?tex$" linter lacheck However, when I press the keyboard shortcut to run the linter, I get an ...
user avatar
  • 71
0 votes
0 answers
61 views

Why I can't open text files when execetue "x" permission is on?

for example I have test_file and I run sudo chmod 775 test_file so now while I'm the owner I can read,write and execute it but with graphical interface it doesn't work, I don't have any error messages ...
user avatar
  • 181
0 votes
0 answers
23 views

Nano: keyboard shortcut to move cursor to the beginning of the next empty line?

In nano text editor: what is the keyboard shortcut to move cursor to the beginning of the next empty line? If there is no default one, then what would be the right one?
user avatar
  • 355
2 votes
0 answers
92 views

Nano c.nanorc format

I like portability between systems and I was trying to make my nano editor look as much as possible like Sublime Text (on Linux Mint). I want to color function names too. So far I managed to make it ...
user avatar
1 vote
1 answer
49 views

Is it possible to show a vim cheatsheet like in Nano at the bottom of the page?

I am using Debian GNU/Linux. Are there any options or extensions to vim that give me the possibility to display a cheat sheet in vim as shown in Nano?
user avatar
1 vote
1 answer
51 views

Using multiple .nanorc files

I am not sure if this can be done or not. I have two different .nanorc files (.nanorc1 and .nanorc2). Each file has different settings. For example one has tabs set to 9 spaces and the other has ...
user avatar
0 votes
1 answer
96 views

How to use locally installed latest version of nano (on CentOS 7) by default? (No admin privileges)

I compiled the nano editor (version 5.3) on CentOS 7. However, which nano gives /usr/bin/nano. nano --version gives GNU nano version 2.3.1. I have locally installed ~/.local/bin/nano --version GNU ...
user avatar
0 votes
1 answer
404 views

Basic linux commands (sudo/apt-get/nano) not found

I'm using Linux sa515 on this application processor but I can't seem to run any of the following commands: sudo apt-get nano It says the corresponding command is not found. Am I missing something?
user avatar
  • 21
1 vote
0 answers
31 views

paste content in nano removes new lines

I have this strange behavior in nano using the Tilix terminal (works in another terminal) where, if I paste something, the new lines are completely removed, content is wrapped and new lines are ...
user avatar
1 vote
1 answer
28 views

need help with my menu program

i'm having issue with the script, the selection 2 and 3 doesn't show anything when executing. #!/bin/bash while true do clear echo "========================" echo "Menu ----"...
user avatar
  • 11
0 votes
0 answers
218 views

Restore empty docker-compose file

I was working on a sizeable docker-compose file using the nano editor. Upon saving it told me I was out of disk space. Without hesitating, I quit nano, extended my LVM and resized the FS as I have ...
user avatar
  • 148
2 votes
0 answers
161 views

Is there a way to have nano to pipe output to another program's input?

I have a program A that pipes its input to nano this way: program_a | nano -. I want to make edits with nano and pipe it again to another program B, without having nano to write anything on the disk (...
user avatar
  • 21
0 votes
0 answers
26 views

How to save gedit changes right along with nano changes, instead of appending ~?

I've got a .nanorc file that I love, records all changes to files when using nano. Gedit, on the other hand, just writes out a file next to the live version with a ~ appended. Is there some bit of ...
user avatar
  • 191
2 votes
1 answer
628 views

Line length marker in nano

How can I highlight a given column using nano? I'm using a fairly large terminal but I would like a mark to know if my code exceeds the limit of let's say 80 characters.
user avatar
  • 71
0 votes
0 answers
48 views

Terminal editor/pager that allows jumping to particular line based on external command or file?

I'd like to script something so that an existing process viewing a listing file jumps to a particular line. The process might be less or nano or, if need be, another pager or editor. I would, if ...
user avatar
  • 121
2 votes
1 answer
275 views

Display full path in title bar of nano editor

The nano editor by default displays only the filename being edited, but not its full path. This can be a problem, if I need to edit old vs new versions of files by the same name. Does anyone know of ...
user avatar
1 vote
1 answer
535 views

How to toggle nano softwrap on mac

I tried the following recommended approaches unsuccessfully to toggle softwrap in nano on MacOS Catalina: I can't do Alt+S as in the manual, it gives ß on my keyboard. Esc-S gives "Smooth scrolling ...
user avatar
0 votes
2 answers
226 views

How to solve the issue where nano screen text is scrambled when using su - admin

In Terminal I su - admin while in my user account to brew update, modify .bashrc, etc. I have noticed that when in my user session changing the size of the window while running nano doesn't scramble ...
user avatar
  • 145
1 vote
2 answers
4k views

Bad regex : Invalid range end

Can you help with this regex in my sourceslist.nanorc ? Regex: cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/ Error: Bad regex "cdrom:\[[a-zA-Z0-9\._-\(\) ]+\]/": Invalid range end Thank you.
user avatar
  • 113
3 votes
1 answer
1k views

sudo: unable to initialize PAM: No such file or directory after editing pam.d

I was playing around with the pam.d file in nano and for some reason along the way I lost root access. Whenever I try to use the sudo command, I get an error like this: [redacted]@[redacted] ~ % sudo ...
user avatar
3 votes
1 answer
3k views

Nano - highlight trailing whitespaces

I use nano as my standard editor for a file type it has no build in syntax-highlighting for LilyPond. It is nothing I really need, though I'm missing out quite a lot of white-space characters at the ...
user avatar
  • 4,750
0 votes
2 answers
87 views

Bash script's array element can't act as a filename for nano, some kind of encoding error

I'm looking to write a bash script that recursively searches directories, find a particular string, then opens to that string in that particular file. I call this function exert because it takes away ...
user avatar
1 vote
0 answers
38 views

Can I open an editor as part of a piping command to edit the piped string? [duplicate]

I would like to do this: git --git-dir=../navcl/.git format-patch -k -1 --stdout 607780ee9 \ | nano \ | git am -3 -k The issue is, in my other git dir, a file path is different, so I need to ...
user avatar
0 votes
0 answers
49 views

is there a way to invoke nano <filename> so it will fail if <filename> doesn't exist?

I am creating a set of instructions like nano /home/username/preexisting-file.txt where, of course, we tell people to replace "username" with their own username. But people still forget, and they ...
user avatar
  • 101
1 vote
0 answers
197 views

Graphical glitches in Nano when using ssh

I have Windows 10 and I'm using ssh in powershell. Nano editor is very glitchy though, when I'm writing something, the cursor suddenly jumps at random places (especially to the rightmost place at the ...
user avatar
0 votes
1 answer
109 views

How to use nano's Redo shortcut (Meta+E) in MATE terminal

I'm using: Debian bullseye with its MATE desktop environment MATE caja 1.22.1 MATE Terminal 1.22.1 GNU nano, version 4.3 In nano, Redo is mapped to Meta+E. In Keyboard Preferences I have selected "...
user avatar
  • 121
1 vote
1 answer
170 views

mc (midnight commander) view (F3) strange behavior when there is a "." in the filename

It seems to ignore newline characters in "parsed" view. In raw view everything is fine. Same thing happens in nano "justified" mode. a) parsed text file b) same file in raw mode c) vi with :set ...
user avatar
1 vote
2 answers
568 views

Unwanted trailing white-spaces comes along on copy-paste

I'm using Tmux & Zsh (WSL) and am very frustrated with all the white-spaces that comes with when copy content from a file while using nano. nano .zshrc . When using Shift+Right Mouse Button or ...
user avatar
  • 19
1 vote
1 answer
846 views

How decrypt a file in nano text editor?

I encrypted a text file in terminal using "gpg -c filename" and got "filename.txt.gpg" created in my file manager. I deleted the original unencrypted file. Now I want to decrypt it in Nano so I can ...
user avatar
  • 41
5 votes
2 answers
1k views

Horizontal scrolling in nano editor?

I am using nano on files with long lines. How could I scroll the nano window horizontally? Ex: ┌────────────┐ |Lorem ipsum |dolor sit amet, consectetur adipiscing elit, |sed do eiusm|od tempor ...
user avatar
  • 153
0 votes
1 answer
956 views

Nano text editor - How to bring back on the syntax coloring?

I am using the Nano text editor. Before, there was color on every command I typed, but now I don't know what buttons I pressed as there are no more colors. How to bring back on the syntax coloring?
user avatar
  • 1
32 votes
3 answers
34k views

How can I set the default editor as nano on my Mac?

I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim". How can I set up "nano" instead and make sure the terminal will open "nano" every ...
user avatar
  • 423
1 vote
0 answers
887 views

Can't create new file with nano, Received SIGHUP or SIGTERM

I found only this question of this subject: Received SIGHUP or SIGTERM: nano cannot edit empty file I'm configuring my web server. There wasn't any problems earlier and I would like to know exactly ...
user avatar
  • 11
0 votes
0 answers
68 views

Output in terminal after quitting program

I'm using Kubuntu with i3, and I've recently migrated from Manjaro because things. My terminal emulator is urxvt but, when I use programs such as vim, less or nano in the terminal remains the part of ...
user avatar
1 vote
2 answers
266 views

Nano editor: are Ctrl keybindings actually bitmasked?

I wanted to make Nano have more common shortcuts (i.e. Ctrl-F for search, Ctrl-H for replace, etc) and edited the nanorc file to add: bind ^F whereis all bind ^H replace all bind ^M mark all ... To ...
user avatar