Your terminal should have a default editor. This is what is used whenever you run commands like
crontab -e
. It may not be set to what you like, or your preferences may have changed. To change it, simply run the following command:
sudo update-alternatives --config editor # You may also need to run this one for crontab select-editor
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLOtdBCBAg6bDp8XKWZvcunt1_ZN9SyJpFHQrhQ2eI3D9dSe27iJbRW6HKFdsen6PZb2UdAUS9F4NZSKeDjvYFnVDftReQ-tikyLghrKkuc7CfLwRLUz7B-vBEzzpsBcw-BGkWi3bKYl6x/s1600/editor.png)
Now enter the number representing the editor you would like to default to
Now that is set, you can use the editor command in substitute for
nano
or vim
. This is great for people who write tutorials because now we don't have to assume what you like to use. For example, I will try to make sure my tutorial steps are like below:
editor my-config-file.txt
Instead of:
vim my-config-file.txt
No comments:
Post a Comment