Ubuntu – Editing .bashrc in WSL safely

bashbashrcwindows-subsystem-for-linux

How do I edit the .bashrc file in Windows Subsystem for Linux safely?

This article warns to never edit files stored in the WSL AppData folder using Windows tools.

But then how do you edit files like .bashrc in a safe manner?

Best Answer

Use the built-in nano editor as:

nano ~/.bashrc

The most important shortcuts for nano are Ctrl+O to save the file and Ctrl+X to close the editor.

A simple guide for using nano can be found in the Gentoo Linux Wiki.

Related Question