Anything but that.

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,498
Reaction score
3,234
Credits
31,331
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. :D

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? :D
 
Last edited:


Hey! I know how to use vi: Escape colon q :p

Isn't the text editor subject the very origin of the term "religious war"? Infidel that I am, I don't actually even use emacs per se... I use a -commercial- product whose original raison de etre was to be an emacs like editor for DOS. Kind of makes me glad we don't still do bonfires with heretics any more.

epsilon_32x32.png

---

Re. T-shirts: "Real men" use ed (which is distinct from ED, which real men don't talk about.)

---

There's a place in the world for GUI text editors, but no system should be without a usable console mode text editor. Even edlin saved my bacon on at least one occasion back in the day.

---

Stop that! We don't do those bonfires any more!
 
T-shirts: "Real men" use ed (which is distinct from ED, which real men don't talk about.)
....I could send this thread off topic in such a big way,....or maybe not so big.....
 


Members online


Latest posts

Top