Nano text editor in Unix/Linux

Nano is a basic text editor that runs in the Unix/Linux command line interface.

To illustrate how the Nano text editor works, we will develop a “Helloworld” Java program using Nano.

  1. In your Unix/Linux account, change to the desired directory (cd command) and type the following command: nano hello.java
  2. This will bring up the following Nano window:
  3. Enter the Java code into the Nano window as shown:
  4. To save the file, use the key combination Ctrl-X (this is indicated as ^X in the Nano window). You will be asked "Save modified buffer"? Answer Y (Yes) to save the file:

To compile and run the Java program after you have saved the file and exited Nano, do the following:

For help with Nano editor commands:


T. Manikas Last update 2024 Aug 17