在Debian中选择crontab编辑器有以下两种方法:
EDITOR=my_editor crontab -e
命令,将my_editor
替换为你想要的编辑器,如nano
或vim
。select-editor
命令,它会列出可选编辑器,输入对应数字选择即可。也可通过编辑~/.bashrc
或~/.bash_profile
文件,添加export EDITOR=/path/to/editor
来永久设置,默认编辑器路径可通过which editor_name
获取,例如which nano
。