16

Didn't DOS used to have an "edit" or something? I'm used to nano, like nano, and want to use nano. Does it install on Windows 10?

https://showtop.info/install-nano-text-editor-windows-10-command-prompt/

The download brought me to some spam, and this generally seems like a good way to get a virus. Going to the website for nano:

https://www.nano-editor.org/

I, at least, am not seeing a download link for Windows. I'm using a Surface 3 (regular, not pro) which runs Windows 10, for what it's worth.

Seems that the "download" link to (something) doesn't work:

https://superuser.com/q/200109/55747

5
  • 1
    Yes, I used to use edit in the MicroSoft Disk Operating System Version 3.0 when I first started fiddling around Personal Computers, Twenty-Seven Years Ago. I have not found it myself in the contemporary era. I am using the CygWin Thingy. It is quite cool. In less than a Hundred Giga-Bytes of Data, it has you-name-it. You can play with nano also using its version. I am myself using joe from time to time. But it is quite safe to create an alias for the NotePad++ Editor and start it from the Command-Line with the & Operator.
    – user1018743
    Commented Oct 18, 2019 at 21:21
  • 1
    Cygwin Package Summary for nano
    – DavidPostill
    Commented Oct 19, 2019 at 20:23
  • going off topic, but cygwin has advantages over the linux sub-system?
    – Thufir
    Commented Oct 20, 2019 at 18:30
  • cygwin is emulated so the performance will be very slow compared to WSL which runs native.
    – madacoda
    Commented Apr 29, 2020 at 17:11
  • simpler than cgwin is probably to just use emacs
    – Thufir
    Commented May 31, 2020 at 7:39

9 Answers 9

29
  1. Install Chocolatey using Powershell:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

(See also chocolatey.org for more info)

  1. Run choco install -y nano.
  2. Run nano: nano.

Alternately, if you already have git installed, just run C:\Program Files\Git\usr\bin\nano.exe

6
  • 4
    Perfect!!! Voted up and this must be answer. Thanks...
    – Jack
    Commented Oct 31, 2020 at 14:53
  • 2
    download from nano-editor.org/dist/v2.5/NT/nano-2.5.3.zip and put the file inside C:\Program Files\Git\bin would also work Commented Jan 6, 2021 at 4:23
  • @KardiTeknomo, that is a good answer. You should submit it as an answer.
    – cowlinator
    Commented Feb 26, 2021 at 21:58
  • 1
    It's the answer, installed nano succefully on windows 10, thanks
    – Mahefa
    Commented Aug 30, 2021 at 11:11
  • Thanks, the first command has slighly changed: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    – pabloasc
    Commented Apr 11, 2022 at 19:40
16

In 2022 you can just easily install Nano via WinGet, which is Windows' package manager.

Open command prompt as admin and type this in:

winget install GNU.Nano
4
  • 1
    This answer should be on the top.
    – Imran
    Commented Jan 25, 2023 at 10:49
  • 3
    Thank you. It worked. Just after install nano was not recognized, had to add c:/program files/WindowsApps to the PATH
    – Laurent
    Commented Feb 2, 2023 at 4:33
  • Also worked great for me, but instead of changing the PATH variable myself, I had to change the name of the executable because it was something like nano-git-adlj223h.exe (it had some letters and numbers) and it wouldn't get picked up by my PS. The executable was at ~\AppData\Local\Microsoft\WinGet\Packages\GNU.Nano_Microsoft.Winget.Source_8wekyb3d8bbwe Commented Feb 20, 2023 at 8:54
  • 1
    @vinkomlacic There should have been symlink created at ~\AppData\Local\Microsoft\WinGet\Links name nano, pointing to the file. It would be better for you to make that rather than rename the package. Commented Mar 27, 2023 at 20:56
4

I highly recommend installing Windows Subsystem for Linux, rather than install individual linux tools in the Windows Command line

Seeing as you are already on Windows 10, this shouldn't be a problem.

See the above link for instructions. But at a high level 1. Enable WSL through a Powershell command 2. Install Debian or Ubuntu from the Microsoft Store 3. Launch Debian/Ubuntu from the Start Menu 4. Run 'sudo apt install nano' if it is not installed by default

If you combine WSL with the new Microsoft Terminal, I think you'll find it works much better than most of the older emulated terminals like Cygwin, Xterm, etc.

But if for some reason you can't install WSL, then Cygwin is the next best thing. It does not have a package repository so you have to select 'nano' during installation as one of the optional components.

2
  • yeah...in this case it's a tablet/tochscreen thing, resource constrained. a microsoft surface 3 with 4gb ram. it pokes along.
    – Thufir
    Commented May 27, 2020 at 2:01
  • Now 9 months later, I would go for WSL2. I works like a charm. I installed using this article: omgubuntu.co.uk/how-to-install-wsl2-on-windows-10. WSL2 needs at least Windows 10 1903. If you are on an earlier version it can easily be upgraded using Windows Update Assistant before installing WSL2.
    – HVL71
    Commented Feb 26, 2021 at 15:51
3

So, this is what I did to use nano via cmd.

You'll find nano.exe in Git\usr\bin (you'll need to have git installed, and you most likely will have). For me, the absolute path is C:\Git\usr\bin. Just add it to Path variable. Then, you'll be able to call nano from anywhere via cmd.

This way you won't have to scour the internet looking for nano.exe.

2
  • 1
    So, you're saying nano comes with git? Commented Sep 29, 2022 at 8:20
  • Yes. Git 2.39.2 for windows comes with 395 linux command-line tools in Git\usr\bin, including nano.
    – cowlinator
    Commented Oct 10, 2023 at 19:55
1

Follow below steps:

  1. download the nano*.exe file from internet
  2. keep it in a nano folder
  3. give the path of this nano.exe file in the env variables (user variables).
  4. Open cmd prompt and type: nano script.sh
  5. command in step 4 will open a nano editor.
2
  • 1
    but where is the nano binary for windows?
    – Thufir
    Commented May 27, 2020 at 1:59
  • You can find nano binaries for Windows (a.k.a. "NT") at nano-editor.org/dist . You might have to dig around. For instance, you can find windows binaries for version 2.5 at nano-editor.org/dist/v2.5/NT , but there doesn't seem to be one for version 5.0 .
    – cowlinator
    Commented Nov 4, 2020 at 20:54
1

get micro. It is way better, and windows native. Also better in linux.

1
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Toto
    Commented Jan 19, 2023 at 17:14
0

There are actually some links and older builds on https://www.nano-editor.org/ but it's not immediately obvious where to look:

  • Get Nano
  • Hit "All Versions: The Packages"
  • v2.5
  • NT
  • nano-2.5.3.zip

Or: https://nano-editor.org/dist/v2.5/NT/

0

To install the latest Nano in Windows-10, follow these steps.

The installation steps are:

  1. Download the latest Nano build (e.g. nano-win_9931_v6.0-14-g010f69c0e.7z) from here:
    https://files.lhmouse.com/nano-win/ OR
    https://github.com/lhmouse/nano-win

  2. Download the latest syntax highlighter files (*.nanorc) from here:
    https://github.com/scopatz/nanorc

  3. Chose an installation location. For example in C:\nano\.

  4. Extract the contents into that directory and move it around so that you have:

#7z x nano-win_9931_v6.0-14-g010f69c0e.7z

# Do some manual moving around here, to get:

C:\nano\bin\       # For the nano.exe
C:\nano\nanorc\    # For all the *.nanorc files
C:\nano\doc\       # For the documentation files
  1. Put the .nanorc into your home directory in C:\Users\<username>\.nanorc.

  2. Add the nano file paths to your System Path, like this:
    Open an elevated Powershell, and run:

# To set and update the Windows (System) "Path" in Powershell, use:
[System.Environment]::SetEnvironmentVariable("PATH", $Env:Path + ";C:\nano\bin", "Machine")
  1. Either reboot, restart explorer, or install refreshenv from choco.

  2. Optional: Run nano once, to ensure that a filepos_history file is created.

  3. You probably want to be able to run Nano with both normal or Administrator privileges, but not having to keep track of more edit locations and 2nd config files. To do this, you need to symlink your own versions of the nano config and history setting files, to the admin versions.

    (For more details see the related github issues here.)

# Link last cursor position files:
New-Item -ItemType SymbolicLink -Path "C:\ProgramData\.local\share\nano\filepos_history" -Target  "C:\Users\<username>\.local\share\nano\filepos_history" -Force
# Link .nanorc files:
New-Item -ItemType SymbolicLink -Path "C:\ProgramData\.nanorc" -Target  "C:\Users\<username>\.nanorc" -Force
  1. IMPORTANT! Edit your .nanorc to include the correct POSIX paths to all your *.nanorc files.
# Why not use nano to edit your .nanorc
cd ~
nano .nanorc

# Add the following line(s):
#include "C:\nano\nanorc\*.nanorc"     # Windows paths does NOT work!
include "/nano/nanorc/*.nanorc"        # This works!

Enjoy!

-5
  1. Download nano-git-0d9a7347243.exe and rename download to nano.exe, moving it to C:\Windows.
  2. Download Nano zipfile, unzip, and move cygwin1.dll to C:\Windows.
  3. Press Win+R and open cmd and use Nano like in Linux: nano text.txt
3
  • 5
    Moving custom stuff into C:\Windows is a bad idea. It's a system location, leave it alone. Instead add nano's path to %PATH% variable.
    – gronostaj
    Commented Jan 10, 2020 at 10:03
  • Of course you can use %PATH% variable (it is right way). But the option I proposed is taken from the instruction on the nano website. README.TXT from the 2 paragraph zip: "INSTALL ------- - Copy cygwin1.dll somewhere where Windows will be able to see it (C:\WINNT or C:\WINNT\SYSTEM32 is good for NT users and C:\WINDOWS or C:\WINDOWS\SYSTEM are good for WIn9x users. You can always leave it in the same directory as the nano executable if you're really lazy. - Put the nano.exe executable somehwere useful (your desktop or C:\WINDOWS perhaps) - Have fun with it." Commented Jan 11, 2020 at 13:58
  • 5
    Those instructions are written with 20 years old OS in mind. Nowadays they are outdated and should not be followed or recommended.
    – gronostaj
    Commented Jan 11, 2020 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .