I think Answers by Muzaffar and Terrance serves your need. One thing to note is that you can install any of these text editors in any flavors.
GUI Text Editors
Gedit
Default in:
- Ubuntu Unity
- Ubuntu Gnome
- Ubuntu Kylin
- Ubuntu Budgie
Gedit is certainly the most famous text editor in the Ubuntu world. Gedit is also available for Windows and MacOS. To install Gedit on any Ubuntu flavor use the following command:
sudo apt-get install gedit
To open a file with gedit:
gedit /path/to.file.txt
Kate
Default in:
- Kubuntu
- KDE Neon (not an official Ubuntu flavor)
it is also available for Windows. Like many KDE apps it has a load of features. To install, run:
sudo apt-get install kate
If you want the latest version of Kate, you'll need to add a PPA:
sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update
sudo apt-get install kate
To open a file with kate:
kate /path/to.file.txt
Leafpad
Unlike Kate, emphasis of Leafpad is on simplicity and lightness, which is whole agenda of the LXDE project. It comes pre-installed on Lubuntu. To install:
sudo apt-get install leafpad
To open a file with leafpad:
leafpad /path/to.file.txt
Mousepad
Default in:
- Xubuntu
- Ubuntu Studio
In philosophy, Mousepad is pretty similar to Leafpad. To install:
sudo apt-get install mousepad
To open a file with mousepad:
mousepad /path/to.file.txt
Pluma
Pluma is a fork of Gedit which comes preinstalled in Ubuntu Mate. To install:
sudo apt-get install pluma
To open a file with pluma:
pluma /path/to.file.txt
*Note: if you want to edit files with root privileges, add gksu
in front of a command, like this:
gksudo gedit path/to/file.txt
It's best to avoid using it with kate
CLI Text Editors
Nano
sudo apt-get install nano
I don't know if Nano is installed on all the Ubuntu flavors, but it's installed on Ubuntu Unity, Ubuntu Gnome and Kubuntu as per my knowledge.
To open a file with nano use following command:
nano /path/to.file.txt
For more information about Nano, see The Beginner’s Guide to Nano, the Linux Command-Line Text Editor.
Vim
sudo apt-get install vim
To open a file with Vim, type either of these two commands:
vim /path/to.file.txt
or
vi /path/to.file.txt
Vim (or at least vi) is installed by default on all Ubuntu (or any other Linux) flavor. If you start to like Vim and want it to have a user interface try Gvim. Also note that on some systems, vi
is aliased to vim
, so both commands do identical things. (which launching vim)
For more knowledge about vim, see A Beginner's Guide to Vim or run vimtutor
in the terminal.
Keep in mind that QT apps don't look good on Gtk based desktop and vice versa. but if you want them to feel at home, try this question How to make KDE applications look native in GNOME?
More Linux Text Editors
Best Answer
You can use vim which should already be installed.
Just to make sure, go ahead and install vim:
Now, use the vim command
:% !xxd -b
to edit binary like in this example:note: you can drag and drop the file into the terminal to automatically fill in the path for you
Once the file is open, press ESC and then type
:% !xxd -b
and then press ENTER.Alternatively, you can add the flag
-g4
to group the bits into 32 bit packets like:% !xxd -b -g4
For hex edit, use the vim command
:% !xxd
instead or:% !xxd -g4
Press ESC and then i for "INSERT" mode which allows you to edit.
Press ESC and then type
:w
followed by ENTER to save the file.Press ESC and then type
:q
followed by ENTER or ESC and then type:q!
followed by ENTER to exit the file.Vim takes some getting used to but is really great once you take the time to learn how it works.
Additionally, vim allows you to edit just about anything including sqlite and all kinds of other stuff.
Also, when you convert a binary to hex and then edit, I think you may need to convert back to binary by using
:% xxd -r
command as described here.More info can be found at the official wiki by clicking here.
Here is a similar post:
https://unix.stackexchange.com/questions/282215/how-to-view-a-binary-file/282220
Click here for more info on editing your .vimrc file to allow some related commands.
A very similar editor is
bvi
. Run the following command to install:Click here for more info.