O que significa “fg”?

1

Não há entrada manual para ctrl-z ou fg.

O que "fg" significa no contexto do controle de trabalho? Em outras palavras, digitar ctrl-z suspenderá o trabalho atual e retornará ao shell, e o comando "fg" reativará o trabalho suspenso. O que significa "fg"?

    
por Tyler Durden 17.03.2017 / 07:47

1 resposta

12

ForeGround.

Assim como em outros internos bash, é help para isso:

$ help fg
fg: fg [job_spec]
    Move job to the foreground.

    Place the job identified by JOB_SPEC in the foreground, making it the
    current job.  If JOB_SPEC is not present, the shell's notion of the
    current job is used.

    Exit Status:
    Status of command placed in foreground, or failure if an error occurs.
$ 

Além disso, bg é BackGround e ^ z está na bash man page , sob Job Control:

   If  the operating system on which bash is running supports job control,
   bash contains facilities to use it.  Typing the suspend character (typ‐
   ically ^Z, Control-Z) while a process is running causes that process to
   be stopped and returns control to bash.   Typing  the  delayed  suspend
   character  (typically  ^Y,  Control-Y) causes the process to be stopped
   when it attempts to read input from the terminal,  and  control  to  be
   returned  to bash.  The user may then manipulate the state of this job,
   using the bg command to continue it in the background, the  fg  command
   to continue it in the foreground, or the kill command to kill it.  A ^Z
   takes effect immediately, and has the additional side effect of causing
   pending output and typeahead to be discarded.
    
por 17.03.2017 / 07:50