Forum

> > Off Topic > Linux nohup command
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch Linux nohup command

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Linux nohup command

GeoB99
Moderator Off Offline

Zitieren
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.

alt Re: Linux nohup command

macnux
User Off Offline

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

alt Re: Linux nohup command

Jaller94
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht