-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
screen is almost certainly what you want. Backgrounding a process and
redirecting it STDOUT and STDERR while giving it STDIN from /dev/null is
all well and good as long as you don’t want the interact with the process
ever again, but screen is more flexible than that and I’d be money it’s
what you’re after. With it you can do the following:
Start multiple processes simultaneously. screen has multiple “windows”
that often get overlooked and are basically multiple shells (somebody
mentioned xterm’s, though technically xterm is an X-application and, as a
result, isn’t the right term in this context… just call it a terminal or
shell) within the same screen. Think of screen as your physical screen
(you likely have just one, though maybe you have multiples) and within
that monitor/screen you can see multiple windows… same idea.
Reconnect to previously-started (and non-X) applications. For example I
will often run a single screen on servers that has multiple “windows” with
each dedicated to a task… tail /var/log/messages, tail the firewall
log, run top, watch the system uptime, etc. The nice thing about this is
that applications which do not show the last few hours’ worth of data
naturally (uptime, for example) can be run regularly (every few minutes)
and when reconnecting to that specific “window” within screen I can see
hours’ worth of data, or I can see what’s the latest stuff in my tailed
system log file (/var/log/messages by default) which will just be what is
new since I last looked.
Start processes now that need to last longer than your SSH connection. I
think Carlos mentioned this with regard to compiles; when compiling X and
it’s five minutes before you need to leave you either waste time by
starting the compile later, or leave you computer behind when you likely
need to take it with you. Anytime I’m running something non-trivial on a
remote system I’ll use screen simply because if my connection blips on any
system between myself and the server (excluding the server) all will be
fine until I get back in. I use it a lot for transferring big files
even… if my SSH connection dies at 98% of a 12 GB file it does not make
me happy; with screen, it just doesn’t matter what the client side does.
Share a terminal with somebody else, even another username on the server,
for training, troubleshooting, collaboration of any kind, etc.
More-advanced when using different users, but screen is REALLY powerful in
this way.
screen takes special keystrokes to manipulate it. C-a (Ctrl+a) is the
start (by default) for most of them if not all of them. Case sensitivity
counts so keep that in mind. An example: disconnect from a screen (to go
back to the calling shell):
C-a d
(means Ctr+a followed by (while not holding Control any longer) a single
‘d’ character). emacs users will likely recognize the shorthand.
Create a new window within a screen (Ctrl+a followed by a ‘c’):
C-a c
Rename the current window (kind of nice when you have multiple):
C-a A
Switch to window 0 (the default window):
C-a 0 #yes, that’s a zero, not an O/oh.
Switch to window 1 (you get the idea);
C-a 1
Screen also has its own copy/paste and scrollback (configurable) buffer.
Test with them, as a non-root user in a safe environment, before going too
crazy on a big production machine. If you copy/paste rm -rf /
with root
you’ll wish you were dead, like always.
More info: man screen
Good luck.
On 03/06/2011 03:20 PM, Carlos E. R. wrote:
> On 2011-03-06 22:06, Viench wrote:
>>
>> Sorry to double post, but I couldn’t edit my post for some reason.
>
> It is in the rules 
>
>> “Screen” seems to work well for my putty needs. However is there a way
>> to have more than one at a time, and see a list of the screens I have
>> running?
>
> man screen?
>
>> Also, I didn’t mean minimize in the traditional X sense. I was
>> referring to letting me manage files and such while programs I started
>> are running. It is not necessarily in reference to this server, but it
>> is general command line knowledge that I would like to know anyway.
>
> You can have a hundred putty sessions, if you want…
>
> If you mean something else, I haven’t understood your question yet.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJNdFpPAAoJEF+XTK08PnB5lGkQAIdi4gdEnol+xscSI8YTlvBL
rRvrVRu8HvLrfnQ83+MEP3AQqE1TVxzHXBpmuJDKRz2WIJ5sKgwps+uts5RNdWsM
7drIa+qg5GuthYxj2XZtF2BXF1Aft7hSVouQpce14H8DcaDmsx21FXksryvSOgIA
OyoRcXy8NP2sF5CZ/qW+/m212VSG1zCap/qJ7OpjZs+umTQ9Le0PCs+Ncu5Ljs8x
Ti+/engJWiTNKLf03bUYFm8F/wGnT6il25bCs6gRUZIh+aIQWKKfAyaxnqGwrvQO
Nkv5HlCgYVzPGoRkAXQj6ltpqFCBS4mJA0oB5xvyp2B3adKGPXx/Y0qIOJiNxquS
CRqNFMseLAaOBGgnLdZEn0lZP2MilrmLaYtnqxt9tH5sYfDrl7Wu5nXTCRkve6dq
P740JqOOLLe0KL7YbELjjl7hhQJ5JUMwnYlntWsL0bAce5bl6gNfPYpr2aj8CnNg
d4mZ2ObEaUDoklxi0EuOmD9GQH6HaTsMKcC8KoJwqvsNfdZCGPjB5yEUVfJnHdTW
8iJ5hAFVcNTzTZTRr+5W1T3PxKQ6bse3/qNv0GZE0Qjv8KSX/bGVWbNXLasMx8fX
L1WCL/EpkL//nmtBFbtvWoqG5HzqCgkg32tGgp1mbllQ+lvufpCneq70SudikTY1
LhalW3ZXijnYuyf77rTh
=0zEl
-----END PGP SIGNATURE-----