[Ilugc] 1D1C - fg

  • From: tkdhanasekar@xxxxxxxxx (Dhana Sekar)
  • Date: Thu, 1 Aug 2013 21:15:47 +0530

command: fg
usage: fg command is used to place a job in foreground.

syntax: $ fg [job number]

example:

1. moving a process in foreground

   start some 3 jobs and run in background

   $ firefox

     ctrl+z

   $ vlc

     ctrl+z

   $ sleep 200

     ctrl+z

now list the jobs

    $ jobs

      [1]   Stopped                 firefox
      [2]-  Stopped                 vlc
      [3]+ Stopped                 sleep 200

   to make the job vlc with jobid 2 to run in foreground

    $ fg 2

    vlc

2. by typing fg will default make the first job to run in foreground

    $ fg

      firefox


regards,
dhanasekar

Other related posts: