The answers so far seem not to be aware of the fact that you can move an already running process to another tmux / screen as this answer points out. You can see a list of all open tmux session for your user with tmux lsĪnd attach to a named tmux session with tmux a -t mynameįind a comprehensive tmux cheat sheet here. You can also have multiple tmux sessions by giving them names with tmux new -s myname You can close it anytime (but not with CTRL+D, rather by closing the window) and return to it later by building up an SSH connection to the same user at the same machine and writing the command tmux attach You now are in a new bash session, in which you can start your program / command. It may not allow you to re-attach, but if you just want to know what it's doing, that should be sufficient.Īs most answers already pointed out - if in an existing SSH session - you use tmux (or screen) with the command tmux To do that, first, find the PID, maybe by searching through ps aux|grep yourcommand, and then: strace -fp YOUR_PID It can take some skill to understand the output, but it should at least give you an idea if the process is running, and if you watch close enough, might catch the filenames it's opening. This tool allows you to see each kernel call made by a process. If you only want to check to see if the process is running, my favorite tool would be strace. Moving an already-running process to Screen I wouldn't recommend trying this out the first time on something important, though. However, if you have already started the command, you might want to look up an article on moving a running command into a screen session. Typically, you would start the session, and then execute your command inside of that session. Both of these tools are available on most Linux systems. If you're searching for screen, you might try a search for "GNU Screen". These tools aren't only useful to check your work from another terminal, but have other features, including sharing your session with another user and making sure that your command doesn't stop if you loose your internet connection. They allow you to create shell sessions which can be attached and unattached from actual logins. These are tools known as "terminal multiplexers". As mentioned, the best option is to use screen or tmux.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |