Editing files
Whether it’s updating configuration files, creating new Linux services, or taking notes during a troubleshooting session, your work on Linux is occasionally going to require you to edit files on the command line. We’re going to cover command-line file editing in detail in Chapter 6, Editing Files on the Command Line, but we’ll give you a very brief overview here.
If you’re limited to a command-line-only environment, there are a few CLI text editors you might use:
- nano: Almost always installed or available; easy to use
- vi: Installed almost everywhere; takes a bit of getting used to
- vim: Easy to install everywhere; more full-featured than
vi
If any of these are not installed, you can install them via your package manager. For example, if you’re using Ubuntu Linux, that’ll be a command like sudo apt-get install nano
(or substitute nano
for vim
). We’ll dive deeper into package management...