Forum

> > Off Topic > Linux nohup command
Forums overviewOff Topic overviewLog in to reply

English Linux nohup command

3 replies
To the start Previous 1 Next To the start

old Re: Linux nohup command

GeoB99
Moderator Off Offline

Quote
nohup
will automatically output the data to a file named nohup.out which is located in the working directory (the directory location which you executed the command line). You've to use a text editor to look up at that file.

Alternatively, you can tell nohup to redirect the output to a defined file. To do so you must use the following command line below.
1
nohup some_command > output.log 2>&1&
output.log is only an example, you can replace the filename with whatever you want.

old Re: Linux nohup command

macnux
User Off Offline

Quote
Thanks for the reply.
Do you mean that I can use tail -f to see the live results of the command?

old Re: Linux nohup command

Jaller94
User Off Offline

Quote
If you can, use
screen
. The program keeps your application alive even when you log out or lose the SSH connection.

1
screen -S my_awesome_cs2d_server ./cs2d_dedicated
Ctrl + C
to shutdown the program
Ctrl + A > D
to detach from the session (program stays alive)

To reconnect to your program, run:
1
screen -x my_awesome_cs2d_server

If the program crashes, the screen session will close too. To see which screen sessions are still active:
1
screen -ls

If you forgot to give it a name, you can connect via the process id seen in the
screen -ls
list, e.g.:
1
screen -x 1573
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview