Home  >  Q&A  >  body text

linux - vi 一个目录,怎么退到控制台

X是一个文件夹名,怎么退回到控制台,我每次都是关闭终端,重新打开,囧

PHP中文网PHP中文网2744 days ago1063

reply all(12)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 15:38:47

    :q Exit
    :q! Force exit without saving

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:38:47

    It’s the same as editing a file :q

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:38:47

    :wq
    Keep exiting

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:38:47

    The questioner presses the esc key to see if there is a cursor at the bottom left of the file. This indicates that you can use the keyboard to enter things. Don’t forget the colon.

    reply
    0
  • PHPz

    PHPz2017-04-17 15:38:47

    :q! Force quit (without saving)
    :wq (save and launch)
    :q (exit without performing changes, read permission)

    reply
    0
  • 黄舟

    黄舟2017-04-17 15:38:47

    Actually, you don’t need to exit vi

    Ctrl + zcan suspend vi

    $> jobs You can check what processes are there

    $> fg You can put vi back into running state

    Of course, you can also use fg %[number] to switch to other processes. For specific numbers, refer to the return result of jobs

    As a lazy person, I think it is faster to use :x to exit, which is equivalent to :wq(save+exit)

    It’s better to use Emacs ^ ^

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 15:38:47

    :! You can directly follow the console command

    Or you can open two tabs

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 15:38:47

    Isn’t it easy to open another terminal

    reply
    0
  • 阿神

    阿神2017-04-17 15:38:47

    Ctrl+z

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:38:47

    : wq, save and exit

    : q! Force quit

    reply
    0
  • Cancelreply