To show line numbers in nano text editor, you can use one of the following methods:
- Use the
--linenumbers
option when opening a file with nano. For example:
nano --linenumbers myfile.txt
-
Press
Ctrl
+C
while editing a file to display the current line number. -
Edit the nano configuration file
/etc/nanorc
and uncomment the line that saysset linenumbers
. -
Use the keyboard shortcut
Alt
+Shift
+3
to quickly toggle line numbers on and off.