• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to show line numbers in Gedit

by admin

In the GNOME Shell desktop environment, accessing gedit is fairly straightforward. Click the Activities icon in the upper-right corner of the desktop window. When the search bar appears, click within the bar to access it, type gedit or text editor, and then click Text Editor.

If desired, you can start gedit from the command-line prompt in a GUI terminal emulator:

$ gedit myfile.txt

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.

1. Open the preferences as shown below.

gedit open preferences

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

gedit line number enable

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

gedit line nums

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

Conclusion

The GNOME Project also provides a graphical text editor for programmers. The gedit editor provides some advanced features such as code syntax highlighting and line numbering, but it was designed to be a bare-bones editor. To spruce up the gedit editor, developers created plugins, which expand the features available in gedit. Plugins include a spell-checker, a terminal emulator, and a file browser.

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to migrate storage (LVM) with pvmove Command
  2. exec: command not found
  3. perf Command Examples in Linux
  4. aws lightsail Command Examples
  5. g++: Compiles C++ source files
  6. k8s-unused-secret-detector Command Examples
  7. Understanding rsyslog Filter Options
  8. How to use the ssh-keygen Command in Linux
  9. aws history: Print the command-line history for AWS CLI commands (Command Examples)
  10. dhcpwn: Test DHCP IP exhaustion attacks and sniff local DHCP traffic

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright