NOHUP Command in UNIX

NOHUP command is used to submit a task as a background process (to run in background.). This is very useful for long running Oracle jobs because it frees up your command prompt so that you can do other work. This is specially very useful when you are connected remotely to the server (Unix database server)  and you want to free up your terminal session.

$nohup > test.log 2>&1 &

let's explain above command in details,

nohup => Submit the task so that it continues to run even after you disconnect your terminal session. => Unix shell script that you want to run in the background

>test.log => Redirect standard output to the test.log

2>$1 => Redirects standard error messages to standard output device. 2 represents standard error device, 1 represents standard output device.

& => runs the task in the background.

To watch the execution of a background process

$tail -f test.log