Is there an easier way to edit a text file in ubuntu?

5,979

Step 1: Install Nautilus Admin Tool

To enable this feature, you must first install Nautilus administrator tool… doing this will allow you to edit file and open folders as administrator..

To install the tool, open Ubuntu terminal or press Ctrl+Alt+T on your keyboard to open the terminal app… then run the commands below: sudo apt install nautilus-admin

Step 2: Using Nautilus Admin

Now that the tool is installed, all you have to do is open Nautilus file browser, right-click a file or folder and select Open As Administrator as shown in the image below…

First run the commands below to reload Nautilus…. sudo nautilus -q

screenshot

When you want to edit files, you’ll see Edit as Administrator… on Folders, you’ll get Open as Administrator. Doing that will prompt you to type your password… this only works if your account is already member on the sudo approved list.. if the user opening a file isn’t authorized to use the sudo command, it won’t work…

This is a very useful tool especially if you’re new to Linux and Ubuntu…

And then, open the desired folder and open it with administrator privilege. now you can edit the text by right click and "open with Other application"

Or you can install gedit

sudo apt-get install gedit

Then:

  • Right-click a text file
  • Select "Properties"
  • Select "Open with" tab
  • Choose among the listed/installed text editors
  • Click "Set as default"
  • Click "Close"
Share:
5,979

Related videos on Youtube

Lorena Tavares
Author by

Lorena Tavares

Updated on September 18, 2022

Comments

  • Lorena Tavares
    Lorena Tavares over 1 year

    I need to edit the etc/bash.bashrc file but the VI is being a little complicated. Is there a way to access the folder directly? Not by command line, and edit by the GUI text editor?

    • Zanna
      Zanna over 5 years
      If you find Vi(m) too cumbersome, you might find it easier to use nano
  • Kev Inski
    Kev Inski over 5 years
    gedit is the default editor in unity and gnome and therefor should be installed. But otherwise clean and great answer.