• VMware

    Learn about VMware virtualization for its products like vsphere ESX and ESXi, vCenter Server, VMware View, VMware P2V and many more

  • Linux

    Step by step configuration tutorials for many of the Linux services like DNS, DHCP, FTP, Samba4 etc including many tips and tricks in Red Hat Linux.

  • Database

    Learn installation and configuration of databases like Oracle, My SQL, Postgresql, etc including many other related tutorials in Linux.

  • How to run a process in background or bring to foreground in Linux

    Running a process in background

    What if you a script which takes more than 24 hours to run so in those cases it is not a good idea to run them on putty as in any case of connection failure your putty would stop working making you run the script again. In those cases you can run the process on background manually as shown below

    For example:
    Run the firefox using below parameter
    # firefox & 

    As you can see the firefox opened up on the background without occupying your terminal in the background.

    Running a process in foreground

    In this case the terminal used for running the process will be locked and as soon as you close the terminal your running process would be terminated. This can be seen  mostly when you are running a very time taking script on a terminal.

    For example:
    Try running firefox from your terminal without using any extra parameter
    # firefox

    Now as you see your terminal is locked and unless you close the firefox browser you won't be use that terminal. It means your process is running on foreground.

    You can bring the process back to forground using the below cmd
    # fg firefox

    Deepak Prasad

    is a techie and an author who is still trying to survive in this IT generation with very little knowledge he has on Linux/Unix, VMware, SAN Storage, Automation, networking etc

    You can follow him on Facebook or Google+

    Do you also have something to share here?
    Join GoLinuxHub Team as an Author, Click here for more information
    How to run a process in background or bring to foreground in Linux How to run a process in background or bring to foreground in Linux Reviewed by Deepak Prasad on Saturday, June 07, 2014 Rating: 5

    No comments:

    Powered by Blogger.