Open the nanorc file: nano ~/.nanorc Turn on line-numbers feature by pasting the following into the nanorc: set linenumbers Opening nano will now automatically show the line numbers.