The Nano Editor is the most famous text editor for the console after vi/vim. What makes it popular is the ease of use.
By default you will not see a gutter area with line numbers when you open a file with Nano, there are multiple ways in which we can enable line numbers in Nano, let's take a look at a few of them.
Using the --linenumbers or -l flag
When you open a file, just add --linenumbers to it.
nano --linenumbers datafile.txt
nano -l datafile.txt
Toggle Line Numbers
If you have already opened a file using nano, and you want to display the line numbers, then you can toggle line numbers as follows,
Esc + n
Alt + Shift + 3
Alt + #
Facing issues? Have Questions? Post them here! I am happy to answer!
- Rename a directory using Linux/Unix command
- ls command to list only directories
- How to Restart or Reload Nginx Server Service on Linux
- 3 ways to clear screen on Linux Terminal
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: sudo: unable to open Read-only file system
- Create Hidden File or Directory using Shell Command
- Command to know the installed Debian version?
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - bash: man: command not found
- How to tar.gz a directory or folder Command
- How to Display content of a file in Terminal Screen?
- How to change bash terminal prompt string and color
- Sort ls command by last modified date and time
- Execute .bin and .run file Ubuntu Linux
- zsh hello world example
- How to check uptime of Linux/Unix/macOS system/server using console command?
- [Fix] Linux - bash: useradd: command not found
- Command to check Last Login or Reboot History of Users and TTYs
- How to install and Configure sar sysstat tools in Ubuntu Linux
- How to use SCP Command to Copy Directory
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to connect to SSH port other than default 22
- Install OpenSSL on Linux/Ubuntu
- Implementing Selection Sort Algorithm as Java Program - Java
- How to enable Do Not Disturb (DND) mode in Microsoft Teams - Teams
- eclipse maven m2e : Cannot complete the install - Eclipse
- Copy all .vcf Mobile Contacts files into one .vcf - HowTos
- How to Insert an Inverted Question Mark on Mac ¿ - MacOS
- Fix - zsh: command not found: pip - zsh
- How to Hum a Song to Google to find it out! [Android and iPhone] - Google
- Fix Error 2711 SQL RBS client - The installer has encountered an unexpected error. The specified Feature name ('Docs') not found in Feature table - SharePoint