[SOLVED] everytime i launch a program, i cant use the console anymore...
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
everytime i launch a program, i cant use the console anymore...
My problem is, that everytime i launch a program, like a virtualbox image, the console launch it, but i cant use it anymore.
I use ssh with putty remotely, and the problem is that if i close putty console, the program closes too...
Can i do something to run the program independently of the console? or keep running after i close?
if its possible, how i can i keep track of it when i open console again?
To be able to use a console again after starting a command you can do two possible things:
1. You can append an ampersand (&) to the command which starts it in the background
2. You can start the command and then hit ^z (ctrl+z) to pause it and then run bg to background it
As for running a program and having it continue after you close the console you can prepend your command with SIGHUP which lets the command ignore a SIGHUP when you log out.
If you need a console session to be maintained between logins, you can also use the screen program, which creates a virtual console that you can disconnect and connect to at will. Sort of like VNC for the console.
& = background, but when i close terminal, background running and foreground running app's are killed
nohup = ?
disown = detaches app's from console, i can close it
meanwhile, im installing screen.
Looks like i can create as many consoles as i want, and switch between them.
But i cant find a point; can i close the ssh shell where i launched screen?
If the answer is "yes", if a login again, i guess simply by doing "#screen" again, i would be able to regain control of the running apps, right?
thank you for the help, i will wait until clarification to start doing tests.
Default keybinding to detach a screen session is CTRL-a + d. You can close your ssh session and the detached screen session will continue running. To re-attach do screen -r. If you have multiple screen sessions going that will list available sessions and you would do screen -r <session#>.
The nohup is simply a script that grabs the SIGHUP handler before starting the command you want to run. The & is a bash language construct that backgrounds the process when it is executed by forking the process before executing it. I'm not familiar with the disown command but will do a little research and report back with anything I find.