# Putty - FreeBSD question



## Stamps (May 23, 2009)

If i use putty to remotely ssh connect to my FreeBSD machine and i use command that will take long time. For example to compile MySQL5 from the source.

is it possible to do it so i can give the command and then turn off putty and server still compiles MySQL until is done? So i don't have to wait with putty turn on until the end?


----------



## Const (May 23, 2009)

I'm not sure but you can try something like this

```
anyCommandHere > /dev/null
```
If I'm not mistaken it should redirect output from your console and be executed without your putty being connect


----------



## Stamps (May 23, 2009)

So something like this is ok:

make install > /dev/null

What abaut this character &.

What does it do if i put it in the end?


----------



## MG (May 23, 2009)

Attach the putty terminal to a system console (/dev/ttyv?):

```
watch -W /dev/ttyv2
```
Now start your process
Type ctrl-w and a not existing terminal name to quit watch
ttyv2 will keep on running when putty is killed.

The screen will not be updated when taking back a running terminal with watch.


----------



## DutchDaemon (May 23, 2009)

I advise you to just install sysutils/screen and be done with it. If you don't want extra software, I'd suggest

[cmd=]somecommand > /var/log/somecommand.log 2>&1 &[/cmd]

When you log back in, just check the logfile to see whether the command has finished ((un)successfully), or run a tail -f on it.

There's also nohup(1) which does roughly the same thing.


----------



## estrabd (May 23, 2009)

Stamps said:
			
		

> If i use putty to remotely ssh connect to my FreeBSD machine and i use command that will take long time. For example to compile MySQL5 from the source.
> 
> is it possible to do it so i can give the command and then turn off putty and server still compiles MySQL until is done? So i don't have to wait with putty turn on until the end?



You want to uses the terminal multiplexer, screen. It is IMHO an indispensable tool.


----------



## tangram (May 23, 2009)

Go for sysutils/screen. This little piece of software will change the way you use SSH connections


----------



## hydra (May 23, 2009)

If you'll be working with Unix like system in the future, screen is really worth learning.


----------



## DutchDaemon (May 23, 2009)

Did someone mention screen already? Look into it!


----------



## Carpetsmoker (May 24, 2009)

misc/tmux work much better than screen IMO, and it comes with a BSD license too.


----------



## estrabd (May 24, 2009)

Carpetsmoker said:
			
		

> misc/tmux work much better than screen IMO, and it comes with a BSD license too.



The point is that a terminal multiplexer is the way to go. Thanks for the suggestion, I'll check it out.


----------



## danger@ (May 24, 2009)

you can read some also here:
http://forums.freebsd.org/showthread.php?t=3599


----------

