Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
38
votes
5
answers
57256
views
How to indent multiple lines in nano
Selecting lines in nano can be achieved using `Esc+A`. With multiple lines selected, how do I then indent all those lines at once?
Selecting lines in nano can be achieved using
Esc+A
. With multiple lines selected, how do I then indent all those lines at once?
52d6c6af
(491 rep)
Dec 22, 2013, 03:51 PM
• Last activity: Aug 6, 2025, 07:19 PM
0
votes
1
answers
43
views
nano, sent selected text to a script
How can you sent selected text to a script? I want to select text with shift+arrows, press e.g. ctrl+c and then the selected text should be sent to my script either as a parameter or as stdin. Been playing with the function `{execute}` in the nanorc file...I know it's not even close to the solution,...
How can you sent selected text to a script?
I want to select text with shift+arrows, press e.g. ctrl+c and then the selected text should be sent to my script either as a parameter or as stdin.
Been playing with the function
{execute}
in the nanorc file...I know it's not even close to the solution, I might have to use a complete different function and syntax....but which?
bind ^c "{execute}|tocb" main
*(my script is called tocb
)*
MrCalvin
(766 rep)
Jul 21, 2025, 12:54 PM
• Last activity: Jul 23, 2025, 07:52 PM
3
votes
3
answers
2739
views
Prevent Nano from creating .save files?
I have a problem with the `Nano` editor. If it ever exits unexpectedly, it leaves behind `.save` files, which are just versions of the edits I was making. Is there a way to disable this behaviour?
I have a problem with the
Nano
editor. If it ever exits unexpectedly, it leaves behind .save
files, which are just versions of the edits I was making. Is there a way to disable this behaviour?
Levi H
(123 rep)
Sep 20, 2018, 10:23 AM
• Last activity: Jun 30, 2025, 01:55 AM
0
votes
1
answers
108
views
How to set nano as default text editor with ghostty when double clicking a file?
When double clicking a file i would like it to open in ghostty terminal emulator with nano i tried putting ```export EDITOR='nano -x'``` and ```export VISUAL='nano -x'``` in the .bashrc file, but does nothing when ghostty is my default terminal. is there a way to achieve that?
When double clicking a file i would like it to open in ghostty terminal emulator with nano
i tried putting
EDITOR='nano -x'
and VISUAL='nano -x'
in the .bashrc file, but does nothing when ghostty is my default terminal.
is there a way to achieve that?
feel
(1 rep)
Jun 20, 2025, 09:10 PM
• Last activity: Jun 27, 2025, 10:42 PM
3
votes
1
answers
2676
views
nano - soft wrap at 80 characters
I would like `nano` to soft-wrap at 80 characters. That is, as I keep typing, the text should flow to the next line beyond 80 characters, without `nano` insert a `\n` newline at 80 characters. set softwrap set tabsize 4 set tabstospaces set fill 72 However, this inserts a newline after each line, wh...
I would like
nano
to soft-wrap at 80 characters. That is, as I keep typing, the text should flow to the next line beyond 80 characters, without nano
insert a \n
newline at 80 characters.
set softwrap
set tabsize 4
set tabstospaces
set fill 72
However, this inserts a newline after each line, when tested with cat.
How do I softwrap and fill simultaneously?
Karthik Nishanth
(133 rep)
Jul 8, 2017, 04:27 PM
• Last activity: Jun 27, 2025, 07:00 AM
57
votes
3
answers
74584
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 time is needed?
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 time is needed?
g_tech
(673 rep)
Feb 20, 2019, 01:45 PM
• Last activity: May 6, 2025, 07:12 PM
0
votes
2
answers
70
views
Hide "Welcome to nano" message
This might be a very silly question, but I really tried and didn't figure it out myself. GNU nano 8.4. When I start it, there is a welcome message: > Welcome to nano. For basic help, type Ctrl+G. How to hide it permanently? I tried to start nano using `nano -x`, but this hides the whole toolbar, whe...
This might be a very silly question, but I really tried and didn't figure it out myself.
GNU nano 8.4. When I start it, there is a welcome message:
> Welcome to nano. For basic help, type Ctrl+G.
How to hide it permanently? I tried to start nano using
nano -x
, but this hides the whole toolbar, whereas I want to hide the welcome message only.
jsx97
(1347 rep)
Apr 7, 2025, 03:19 PM
• Last activity: Apr 7, 2025, 04:00 PM
0
votes
1
answers
28
views
nano: Adding Indents To A 'softwrap' Line?
I use ```softwrap``` in ```nano```, because I find it more comfortable. However, every once in a while, I'm not paying enough attention, and I'll nuke part of a wrapped line, since it doesn't have any indentation. Is it possible to have a ```softwrapped``` line begin at the same indentation as the l...
I use
in
, because I find it more comfortable. However, every once in a while, I'm not paying enough attention, and I'll nuke part of a wrapped line, since it doesn't have any indentation.
Is it possible to have a
line begin at the same indentation as the line started? I dug though the manual, I already use
, but that's not relevant to wrapping. My search skills are failing me :) Or, it can't work that way.
Decoherent
(61 rep)
Feb 17, 2025, 06:30 AM
• Last activity: Feb 17, 2025, 06:17 PM
0
votes
0
answers
51
views
How can I Colorize my custom .bashrc file w/ nano in shell
im using an arch linux variant with xfce, opening up a terminal shell and running **sudo nano .bashrc** I can see the file is colorized despite there being no headers referencing a schema. Looking inside dir ***/usr/share/nano-syntax-highlighting/*** shows no file for bashrc configs I would like to...
im using an arch linux variant with xfce, opening up a terminal shell and running **sudo nano .bashrc** I can see the file is colorized despite there being no headers referencing a schema.
Looking inside dir ***/usr/share/nano-syntax-highlighting/*** shows no file for bashrc configs
I would like to use the same colors that are used for**.bashrc** for my **.customrc** file.
How and where can I set this?
Rachel1983
(23 rep)
Feb 9, 2025, 05:03 AM
• Last activity: Feb 9, 2025, 10:41 AM
1
votes
2
answers
198
views
Nano path to save cursor position and searchs
Anytime I exit the nano editor, I get an error like this: > Unable to create directory /home/oloco/.config/local/share/nano/: No > such file or directory It is required for saving/loading search > history or cursor positions Is there a way in order to configure the path so that I dont have to save i...
Anytime I exit the nano editor, I get an error like this:
> Unable to create directory /home/oloco/.config/local/share/nano/: No
> such file or directory It is required for saving/loading search
> history or cursor positions
Is there a way in order to configure the path so that I dont have to save it in that place?
Thanks in advance!
FueraDeServicio
(21 rep)
Feb 25, 2024, 11:59 AM
• Last activity: Jan 7, 2025, 12:34 AM
0
votes
2
answers
140
views
Trying to sort in alphabetical order of last name but needs to be formatted ID, first name, last name
No matter what I try with cut, awk, sed, or grep, it orders by ID first only then last name then first name when it should go in order of last name so it instead should look like f132b02: Kiara Acevedo f132a01: Caleb Barn but instead it orders it by ID and not alphabetical last name and output looks...
No matter what I try with cut, awk, sed, or grep, it orders by ID first only then last name then first name when it should go in order of last name so it instead should look like
f132b02: Kiara Acevedo
f132a01: Caleb Barn
but instead it orders it by ID and not alphabetical last name and output looks like this
f132a01: Barn, Caleb
f132b02: Acevedo, Kiara
the information from the folder I'm retrieving the information is extracted from "~/Homework4/etc/passwd" and is trying to order the IDs below
f132a01:Barn Caleb
f132a02:Casey Nathan
f132a03:Sanchez Ana
f132a04:Thomas Jeff
f132a05:Cavhill Jared
f132b01:Johnson Andrew
f132b02:Acevedo Kiara
f132b03:Felaccio Steven
f132b05:Blotner Sam
f132b06:Pereira Brian
The code I've been trying is down below:
INPUT:
cut -d: -f1,5 /etc/passwd | grep f132 | \
username, first name, and last name
sed -E 's/(.*), (.*) (.*)/\1 \2 \3/' | \
sort -k3
echo
count=$(cut -d: -f1,5 /etc/passwd | grep f132 | wc -l)
echo "Number of students in the class: $count"
OUTPUT:
f132a01:Barn Caleb
f132a02:Casey Nathan
f132a03:Sanchez Ana
f132a04:Thomas Jeff
f132a05:Cavhill Jared
f132b01:Johnson Andrew
f132b02:Acevedo Kiara
f132b03:Felaccio Steven
f132b05:Blotner Sam
f132b06:Pereira Brian
Natasha Shorrock
(5 rep)
Sep 29, 2024, 09:15 PM
• Last activity: Oct 7, 2024, 08:05 PM
3
votes
1
answers
648
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 (The processed data is sensitive, and I want it to be only written as encrypted or processed wi...
I have a program A that pipes its input to nano this way:
| 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 (The processed data is sensitive, and I want it to be only written as encrypted or processed within RAM; program B is actually an encryption program).
In order to achieve my goal, I know of solutions requiring the creation of a *tmpfs* on the RAM, this I would like to avoid.
Do you have any suggestions?
Loutr_
(31 rep)
Aug 24, 2020, 11:25 AM
• Last activity: Oct 6, 2024, 12:30 PM
15
votes
2
answers
48684
views
GNU nano 2: DOS Format or Mac Format on Linux
Which format (Mac or DOS) should I use on Linux PCs/Clusters? [I know the difference](https://stackoverflow.com/questions/28617814/difference-between-dos-format-and-mac-format): - DOS format uses "carriage return" (CR or `\r`) then "line feed" (LF or `\n`). - Mac format uses "carriage return" (CR or...
Which format (Mac or DOS) should I use on Linux PCs/Clusters?
[I know the difference](https://stackoverflow.com/questions/28617814/difference-between-dos-format-and-mac-format) :
- DOS format uses "carriage return" (CR or
\r
) then "line feed" (LF or \n
).
- Mac format uses "carriage return" (CR or \r
)
- Unix uses "line feed" (LF or \n
)
I also know [how to select the option](https://stackoverflow.com/questions/13368223/nano-2-0-6-saving-a-file-in-mac-format) :
- AltM for Mac format
- AltD for DOS format
But there is no UNIX format.
Then save the file with Enter.

JoKalliauer
(579 rep)
Oct 6, 2017, 05:26 PM
• Last activity: Jul 14, 2024, 05:22 PM
37
votes
1
answers
77386
views
How to comment multiple lines in nano at once?
I can able to select multiple lines using Esc+A . After this, what shortcut(s) should I use to comment/uncomment the selected lines?
I can able to select multiple lines using Esc+A. After this, what shortcut(s) should I use to comment/uncomment the selected lines?
krkart
(625 rep)
Aug 4, 2018, 07:29 AM
• Last activity: Jun 7, 2024, 06:38 PM
10
votes
2
answers
9625
views
How to 'UnJustify!' text in GNU nano
I enjoy using `nano` as a respite from my usual GTK-based text editor. I like the simplicity of the interface, and using CTRL-K is the fastest way I know of to edit down long textfiles. However, I have one major gripe: whenever I justify text using CTRL-J, the editor prints the smug little message `...
I enjoy using
nano
as a respite from my usual GTK-based text editor. I like the simplicity of the interface, and using CTRL-K is the fastest way I know of to edit down long textfiles.
However, I have one major gripe: whenever I justify text using CTRL-J, the editor prints the smug little message Can now UnJustify!
-- yet I have not been able to find a way to unjustify text. Pressing M-U (which a Google search could reveal, M-U not being mentioned at all in the program's help files) simply seems to cause a glitch. The keyboard becomes unresponsive. Am I missing something?
ixtmixilix
(13520 rep)
Jul 12, 2011, 01:07 PM
• Last activity: Jun 1, 2024, 07:21 PM
75
votes
3
answers
45436
views
What does "XOFF ignored, mumble mumble" error mean?
While trying to save a file out of Nano the other day, I got an error message saying "XOFF ignored, mumble mumble". I have no idea what that's supposed to mean. Any insights?
While trying to save a file out of Nano the other day, I got an error message saying "XOFF ignored, mumble mumble". I have no idea what that's supposed to mean. Any insights?
nathangiesbrecht
(930 rep)
Apr 3, 2013, 06:39 PM
• Last activity: May 24, 2024, 09:03 PM
6
votes
3
answers
2397
views
Can I/how to specify colors in hex or RGB in nano syntax highlight config?
I enabled syntax highlight in nano (PHP), but not happy with the default, I would like for example to have the comments displayed in very light grey. However, the documentation I found seems to suggest I can only write colors like "yellow", "red" etc. Is there a way to specify a color by its hex/RGB...
I enabled syntax highlight in nano (PHP), but not happy with the default, I would like for example to have the comments displayed in very light grey.
However, the documentation I found seems to suggest I can only write colors like "yellow", "red" etc.
Is there a way to specify a color by its hex/RGB code?
Is there a limitation in the number of colors bash/nano and so on can display? Obviously I am not very experienced with the Linux world.
Same question for VIM, I might switch to VIM if that is not possible.
bg17aw
(163 rep)
Dec 19, 2015, 05:20 PM
• Last activity: May 23, 2024, 05:53 AM
2
votes
1
answers
548
views
nano command execution stuck
In `nano` v8.0 there's an option to send selection to X clipboard in the `nanorc`: "{execute}|xsel -ib{enter}{undo}" which does perfectly. I tried using `xclip` utility instead: "{execute}|xclip -sel c{enter}{undo}" The result was an infinite execution `[ Executing... ]`, insensitive to interaction...
In
nano
v8.0 there's an option to send selection to X clipboard in the nanorc
:
"{execute}|xsel -ib{enter}{undo}"
which does perfectly.
I tried using xclip
utility instead:
"{execute}|xclip -sel c{enter}{undo}"
The result was an infinite execution [ Executing... ]
, insensitive to interaction until hit ^C
. After the cancelling it appeared done the copying, no errors, but what's with the stuckage? Why does it happen and is there a fix?
I'm on Kubuntu 20.04.6 LTS (Focal Fossa).
Multifix
(145 rep)
May 5, 2024, 12:25 PM
• Last activity: May 6, 2024, 02:10 PM
6
votes
1
answers
1738
views
Nano: how to just open a new file buffer inside of nano without altering the current one?
I love the `nano` feature that enables you to open multiple files at once and the fact that switching between them is very easy: ```sh nano file1 file2 etc. ``` However, when I try to open a new file while working on one with `^R`, it just inserts the whole fine within the file I was working on afte...
I love the
nano
feature that enables you to open multiple files at once and the fact that switching between them is very easy:
nano file1 file2 etc.
However, when I try to open a new file while working on one with ^R
, it just inserts the whole fine within the file I was working on after I enter it. What I want to know is how to open a separate tab with a different file. M-F
just gives me an error that says "[No formatter is defined for this type of file]".
thinksinbinary
(217 rep)
Jul 16, 2022, 10:01 PM
• Last activity: Apr 20, 2024, 05:30 PM
0
votes
1
answers
88
views
The key combination Alt + 6 for copy in nano does not work in GNOME terminal emulator Tilix
The key combination `Alt + 6` for copy in `nano` does not work in `tilix` **Does anyone know how to fix this?** I had a look through all the key commands, but did not find any entry for `Alt + 6` being already in use.
The key combination
Alt + 6
for copy in nano
does not work in tilix
**Does anyone know how to fix this?** I had a look through all the key commands, but did not find any entry for Alt + 6
being already in use.
nath
(6094 rep)
Dec 17, 2023, 06:42 AM
• Last activity: Mar 29, 2024, 08:53 AM
Showing page 1 of 20 total questions