This will be the most "non-command-line" post I've ever posted under "Command Line".
So then, why put it here? I thought about posting this under desktop, but maybe it really does belong here I think.
The is very beginner - basic stuff here. We will be doing this from the command line.
At some point we all have to edit some files in Linux. It's just the way it is. If you're changing a system configuration file
you have to do this as root or at least have sudo root privileges.
If you've been using Linux for very long, you're probably familiar with nano. If you've been using it more than a few years
chances are you use vi or vim. If you're masochistic like @CaffeineAddict , @osprey, @MikeRocor and @KGIII you use emacs.
I personally am of the opinion; every good Linux system admin should be familiar with vi. At the very least they should
know how to use nano. But for the real newbies who have never used a command line, is there a way around this?
sigh. yes there is. This is a very simple hack, most of us have done it at some point. It's obvious to many, but for those
who haven't tried this yet. I need to edit a file, but I don't want to use vi or nano, how do I do it?
Well, it depends of which desktop environment you're using. But generally it looks like this...
For Gnome
For KDE/Plasma
For MATE
For xfce
For older versions of Gnome
Easy enough, right? But what if you need to edit a system file as root? Basically, it's the same thing, with a sudo in front of it.
I'm sure I'm leaving out at least one of two desktop editors here, but it's the same idea for any of them.
This should get you by until you learn how to use a command line text editor.
I have a t-shirt that says "Real men use vi". We just had a distro bashing thread, maybe it's time to start a text editor bashing thread?
So then, why put it here? I thought about posting this under desktop, but maybe it really does belong here I think.
The is very beginner - basic stuff here. We will be doing this from the command line.
At some point we all have to edit some files in Linux. It's just the way it is. If you're changing a system configuration file
you have to do this as root or at least have sudo root privileges.
If you've been using Linux for very long, you're probably familiar with nano. If you've been using it more than a few years
chances are you use vi or vim. If you're masochistic like @CaffeineAddict , @osprey, @MikeRocor and @KGIII you use emacs.

I personally am of the opinion; every good Linux system admin should be familiar with vi. At the very least they should
know how to use nano. But for the real newbies who have never used a command line, is there a way around this?
sigh. yes there is. This is a very simple hack, most of us have done it at some point. It's obvious to many, but for those
who haven't tried this yet. I need to edit a file, but I don't want to use vi or nano, how do I do it?
Well, it depends of which desktop environment you're using. But generally it looks like this...
For Gnome
Code:
gnome-text-editor my-text-file.txt
For KDE/Plasma
Code:
kate some-text-file.txt
For MATE
Code:
pluma another-text-file.txt
For xfce
Code:
mousepad yet-another-text-file.txt
For older versions of Gnome
Code:
gedit so-many-text-files.txt
Easy enough, right? But what if you need to edit a system file as root? Basically, it's the same thing, with a sudo in front of it.
Code:
sudo kate /etc/fstab
Code:
sudo gnome-text-editor /etc/exports
I'm sure I'm leaving out at least one of two desktop editors here, but it's the same idea for any of them.
This should get you by until you learn how to use a command line text editor.
I have a t-shirt that says "Real men use vi". We just had a distro bashing thread, maybe it's time to start a text editor bashing thread?

Last edited: