# How to attach to some deattached process



## olo (Oct 25, 2013)

Hi,

I started some task using `CMD &` (with `&` after). Now the task is in the background. Can I attach to it using some command? Is it possible to attach this task to a file from/to which I would be able to read and write like with a device file? Can I write and read to/from some file under /proc (after mounting procfs of course)? I know about screen and tmux but it's not that what I am looking for.


----------



## DutchDaemon (Oct 25, 2013)

Try `fg`.


----------



## ShelLuser (Oct 25, 2013)

And to extend on @DutchDaemon; another nice trick: if you have a process active which you want to leave running in the background you can press Control-Z to pause ("Halt") the process. After which `bg` will, well, put the process into the background.

Isn't Unix cool?


----------



## olo (Oct 26, 2013)

It really is. Thanks


----------

