Like the overwhelming majority of traditional Unix configuration files, /etc/environment
is just a regular text file. You can manipulate it using whatever tools you want.
Of course, that means the administrator might make a mistake when editing the file. So, it would be a very good idea to test any changes by opening a second terminal session without first closing the session that was used to make the change. If it turns out your change was bad, you can then use the first session to fix it.
The flipside of the configuration file being a regular text file is that you are not limited to some special tools. So, you can:
- easily make and restore backups of the file you're editing
- place the file under control of
git
or some version control system, if you want
You might want to check out etckeeper: a collection of tools to allow placing your entire /etc
directory under git
or some other version control system, while keeping track of file permissions and other details version control systems might normally ignore. At least in Debian and related distributions, it is available in the standard package collection.