Ctrl-z之后重新进入交互模式


57

在交互模式下(在OctavegnuplotR等),我偶尔会误按Control+ z。这将暂停程序并将我踢回终端。

是否可以重新进入原始交互模式(使用所有存储的变量)?

复制:

~> octave
octave:1> a = [1:10];
octave:2> ^Z
[1]+  Stopped                 octave
~> 

如何使用a定义的变量恢复会话?

Answers:


77

输入fg并打入enter终端。

   fg [jobspec]
          Resume jobspec in the foreground, and make
          it  the  current  job.   If jobspec is not
          present, the shell’s notion of the current
          job  is used.  The return value is that of
          the command placed into the foreground, or
          failure  if  run  when job control is dis-
          abled  or,  when  run  with  job   control
          enabled,  if  jobspec  does  not specify a
          valid job or jobspec specifies a job  that
          was started without job control.

11

键入以下内容以将作业再次拉到前台:

fg

这是因为您暂停了工作,这意味着它在看不到它的情况下什么也不做。实际上,您也可以让作业在后台运行(输入bg)。有关更多信息,请参见作业控制


3

您可以fg用来将前台活动带回

要么

您可以用于bg将当前活动移至后台。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.