The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pid of nohup process rein Shell Programming and Scripting 2 10-23-2007 03:42 PM
nohup process hangs Sully Shell Programming and Scripting 2 11-02-2005 01:53 PM
background process zylwyz UNIX for Dummies Questions & Answers 5 07-12-2005 12:17 PM
background process badshah High Level Programming 3 05-30-2003 08:01 AM
capture the process id when starting a background process jleavitt Shell Programming and Scripting 10 04-04-2002 05:04 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-03-2007
Registered User
 

Join Date: Aug 2007
Posts: 5
nohup and background process

What is the difference between running a process using nohup and running a process in background ? Please explain
Reply With Quote
Forum Sponsor
  #2  
Old 09-03-2007
Registered User
 

Join Date: Jul 2005
Posts: 24
Hi,

nohup - no hangup

when you suffix with & for running some task, this task will run in background.
example

cat ex.txt|sort &

if you want to continue this job after you log out from your terminal, you can prefix with nohup

nohup cat ex.txt|nohup sort &

Thanks,
Shahnaz.
Reply With Quote
  #3  
Old 09-04-2007
Registered User
 

Join Date: Aug 2007
Posts: 5
difference between nohup and &

what is the difference between nohup and & say

1)nohup cat test.dat

and

2)cat test.dat &

and

3) nohup cat test.dat &

By nohup you say no hangup, what do you mean by no hangup? Please explain more

Thanks
Reply With Quote
  #4  
Old 09-04-2007
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 798
Quote:
Originally Posted by srksn View Post
By nohup you say no hangup, what do you mean by no hangup? Please explain more
From the documentation of nohup:
Code:
Run a command immune to hangups, runs the given COMMAND with hangup signals ignored,
so that the command can continue running in the background after you log out.
Code:
`nohup' does not automatically put the command it runs in the background;
you must do that explicitly, by ending the command line with an `&'.
Reply With Quote
  #5  
Old 09-04-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by srksn View Post
By nohup you say no hangup, what do you mean by no hangup? Please explain more.
When you run a command from an interactive shell you have a "controlling terminal" managed by sshd, telnetd, xterm or whatever.

Then that controlling terminal closes it sends the processes under it's umbrella a 'SIGHUP' signal, this will normally kill those processes. 'nohup' traps this signal and may detach from the controlling terminal.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
nohup

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0