Linux Platform

fg

Ramener une tâche en avant-plan

avant-plantâcherepriseshell

Syntaxe

fg [NUMÉRO_TÂCHE]

Options principales

OptionDescription
%nRamener la tâche numéro n en avant-plan
%+Ramener la tâche courante (la plus récente)
%-Ramener la tâche précédente
%%Synonyme de %+ (tâche courante)

Exemples

Ramener une tâche en arrière-plan vers l'avant-plan

$ sleep 600 &
[1] 2345
$ fg %1
sleep 600

Ramener la tâche la plus récente

$ vim config.yaml &
[1] 3456
$ nano script.sh &
[2] 3478
$ fg
nano script.sh

Reprendre une tâche suspendue en avant-plan

$ top
^Z
[1]+  Stopped                 top
$ echo "Vérification terminée"
Vérification terminée
$ fg %1
top