Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于bash命令/Linux的两个问题_Linux_Bash_Command_Kernel_Vi - Fatal编程技术网

关于bash命令/Linux的两个问题

关于bash命令/Linux的两个问题,linux,bash,command,kernel,vi,Linux,Bash,Command,Kernel,Vi,我需要这些问题的答案: 在Linux中,如何以及在何处更改用户配置文件中的默认应用程序 如何在vi编辑器中保存更改而不退出?我猜是w q!但我不确定 在Linux中,如何以及在何处更改用户配置文件中的默认应用程序 我猜你指的是编辑。如果是,请使用以下方法: export EDITOR=vi #or whatever other editor 要使其永久化,请将此行添加到用户主页中的.bashrc文件中,即~/.bashrc中 如何在vi编辑器中保存更改而不退出?我猜是w q!但我不确定 使用

我需要这些问题的答案:

  • 在Linux中,如何以及在何处更改用户配置文件中的默认应用程序
  • 如何在vi编辑器中保存更改而不退出?我猜是w q!但我不确定
  • 在Linux中,如何以及在何处更改用户配置文件中的默认应用程序

    我猜你指的是编辑。如果是,请使用以下方法:

    export EDITOR=vi #or whatever other editor
    
    要使其永久化,请将此行添加到用户主页中的
    .bashrc
    文件中,即
    ~/.bashrc


    如何在vi编辑器中保存更改而不退出?我猜是w q!但我不确定


    使用
    :w
    保存。你必须处于命令模式(按Esc键去那里)。

    thx fedorqui有人有第一个吗?刚刚更新回答第一个问题,@MateuszOsuchSo,我需要在/home/user/.bash_profile?中添加“export EDITOR=vi”以使其永久化,是的,@mateuszoso。如果我不想使其永久化?我是说我应该把身份证放在哪里。您是否了解
    手动xdg设置