Wondering how to keep your ssh processes after you terminate a session?
Steps by steps guide
-
sshinto your remote server, typescreenthen start any long running process you want.- For example, watching a directory for new files
watch -d ls -lAhFv <dir>
- For example, watching a directory for new files
- Press
Ctrl-A(^-A) thenCtrl-D(^-D)- This will detach your screen session but leave your processes running. You can now log out of the remote server.
- When you want to resume your session, log on again and type
screen -r- This will resume your
screensession, and you can see the output of your long running process.
- This will resume your
![]()