Skip to main content

Foreground & Background Jobs in Red Hat

Foreground & Background Jobs in Red Hat

The bash shell also provides ways for you to change whether a process is running in the foreground, the background, or at all, from the shell prompt. Some additional job control related shell commands are:

1. Ctrl+c: Terminate the foreground process. This causes the foreground process to exit completely.
2. Ctrl+z:  Suspend the foreground process. This causes the foreground process to stop executing and returns you to shell prompt. The program will stay in memory, hanging. From here the process can be back grounded or killed, but if you do nothing it will just wait, detached from the shell, until the shell exits.
3. jobs: list back grounded and stopped process associated with this shell prompt.
4. fg: Send a job to the foreground. Only one process can run in the foreground in a shell. If no argument is given, it will foreground the current job (shown with a + in the output of jobs). Pass fg the job ID to manage jobs other than the current job:
[student@serverx ~]$ sleep 3000 &
[1] 22252
[student@serverx ~]$ sleep 4000 &
[1] 22253
[student@serverx ~]$ sleep 5000 &
[1] 22254
[student@serverx ~]$ jobs
[1]   Running                   sleep 3000&
[2]-  Running                   sleep 4000&
[3]+ Running                   sleep 5000&
[student@serverx ~]$ fg
sleep 5000
 ctrl+c
[student@serverx ~]$ jobs

[1]-  Running                   sleep 4000&
[2]+ Running                   sleep 5000&
[student@serverx ~]$ fg 1
sleep 3000

5. bg: Send a job to the background. Many jobs can run in the background in a singel shell, if no argument is given, bg will background the current job (just like fg foregrounds the current job) as through the job had been started with &.








Comments

Popular posts from this blog

Install CentOS or Multiple OS in single USB stick

YUMI – MultiBoot Live USB Creator YUMI (Your Universal Multiboot Installer), is a MultiBoot Live USB Creation Tool that can be used to quickly and easily build custom bootable USB Flash Drives containing multiple Live Linux distributions, Windows installers, Antivirus tools,  system diagnostic, and troubleshooting software of your choosing. YUMI can create a Bootable UFD containing the following Semplice Web Converger Liberte Linux Pear Linux OCZ Tools Terralinux Matriux (penetration testing) Deft 7 (forensics) Netrunner OSGeo Live Archlinux BackBox Linux (Security and Forensics Tools) HP SmartStart, HP Firmware Maintenance, and HP Automatic Firmware Update Tools F-Secure Rescue CD Fuduntu Slacko Puppy 5.3 Ultimate Edition 3 Mandriva 2011 Zorin OS Bodhi CAELinux (Computer Aided Engineering) XBMC XMBCbuntu CentOS Rescatux DRBL (Diskless Remote Boot in Linux) SalineOS Porteus Sn0wL1nuX Pinguy OS Fedora 15/16/17 G DATA Antivirus OpenSUSE 11/...

Installation Red Hat Enterprise & make standered partition

First of all select DVD and reboot your computer. After Booting from DVD you will get below screen. Select  Install or Upgrade an Existing System and press Enter. If you get the following screen then let Anaconda take another step. Select your preferred  Language and Select  Keyboard Layout . In Following Screen you will be able to see 4 Installation Methods, Let me explain Methods here:- Local CD/DVD – It is obvious that If you use CD/DVD media then Choose this option. Hard Drive – Select this if you have dumped your source into any other Linux partition. NFS Directory – You can select this option if you have configured NFS server. URL – Select this if you want to install using FTP or HTTP Source link. So for step by step installation of RHEL 6 I had  Local CD/DVD Installation Method. If you are not sure about your media then select  OK to verify else select  Skip . If your media is fine till now it will take ...

Red Hat Enterprise version list

Red Hat Enterprise Linux 6 Release/Update General Availability Date redhat-release Errata Date* Kernel Version RHEL 6 Update 4 TBA TBA TBA RHEL 6 Update 3 2012-06-20 2012-06-19 RHSA-2012-0862 2.6.32-279 RHEL 6 Update 2 2011-12-06 2011-12-06 RHEA-2011:1743 2.6.32-220 RHEL 6 Update 1 2011-05-19 2011-05-19 RHEA-2011:0540 2.6.32-131.0.15 RHEL 6 GA 2010-11-09 - 2.6.32-71 Codename: Santiago (based on a mix of Fedora 12, Fedora 13, and several modifications) Red Hat Enterprise Linux 5 Release/Update General Availability Date redhat-release Errata Date* Kernel Version RHEL 5 Update 9 TBA TBA TBA RHEL 5 Update 8 02/20/2012 02/20/2012 RHEA-2012:0315 2.6.18-308 RHEL 5 Update 7 07/21/2011 07/20/2011 RHEA-2011:0977 2.6.18-274 RHEL 5 Update 6 01/13/2011 01/12/2011 RHEA-2011:0020 2.6.18-238 RHEL 5 Update 5 03/30/2010 03/30/2010 RHEA-2010:0207 2.6.18-194 RHEL 5 Update 4 09/02/2009 09/02/2009 ...