Search

Show line numbers in Gedit


Gedit is a popular text editor in Linux. If we want every line in the text file to be shown with a line number automatically, we can do so by enabling it in the preferences.

Open the preferences as shown below.



On the view tab, select the Display line numbers and close the preferences window.



Now as you type in the file, each line will be shown with a line number.



But note that this is just to display and the line numbers are not part of the file that gets saved.