Linux command
editor 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Open the default editor
editor [file.txt]
Change default editor
sudo update-alternatives --config editor
Set editor via environment
export EDITOR=vim
Set visual editor
export VISUAL=nano
说明
editor is a symbolic link or alias to the system's default text editor. On Debian-based systems, it's managed by the alternatives system and typically points to nano, vim, or another installed editor. The editor command provides a standard way for programs to invoke a text editor. Commands like crontab, visudo, and git commit use the EDITOR or VISUAL environment variables to determine which editor to launch.
FAQ
What is the editor command used for?
editor is a symbolic link or alias to the system's default text editor. On Debian-based systems, it's managed by the alternatives system and typically points to nano, vim, or another installed editor. The editor command provides a standard way for programs to invoke a text editor. Commands like crontab, visudo, and git commit use the EDITOR or VISUAL environment variables to determine which editor to launch.
How do I run a basic editor example?
Run `editor [file.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more editor examples?
This page includes 4 examples for editor, plus related commands for nearby Linux tasks.