GNU nano is a text editor for Unix-like computing systems or operating environments using a command line interface.
apt update -y && apt install -y nano
dnf upgrade --refresh -y && dnf -y install nano
To open an existing text file or to create a new one, just run:
nano <file pathname>
To save the file after editing press Ctrl + X and then Y. To exit without saving press Ctrl + X anf then N.