Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
To keep a program running while not logged on, you need to use the prefix your command with the word nohup. You will need to run this command in the background.
for example:
$ nohup grep 'director' emp.lst & | nohup sort &
The above command will search the file 'emp.lst' for the word 'director' and then the entire output from the first command is sent to the 'sort' command which arranges the results in ASCII sequence. Note the use of ampersand sign (&), which keeps the job running in the background.
Use screen. I love it, it's very versatile and pretty simple to use.
Example: I use the pftp-mew FTP client. If I want to download something to my home computer from school or work I just SSH to my home box, type screen pftp to launch a screen session running pftp. I start up a download and then press Ctrl+A and then Ctrl+D to disconnect from the screen. You will be returned to your shell. Log off if you want to. Later on you can log in and reconnect to the screen session using screen -r to see how your download is progressing.
You can also type screen without any parameters. This will launch a screen session running bash (if that's your default shell). Start compiling or whatever you want, then again use Ctrl+A, Ctrl+D to detach from the session. I use this frequently (all the time actually) to run my Enemy Territory server. It works with pretty much any console application and it's darn handy. You can have several sessions going on at the same time, divided into different "windows" (I don't recall the correct term at the moment, sorry).
Start a new screen session, and then type Ctrl+A, Ctrl+C to create a new window. You can run anything here (as usual), then type Ctrl+A, Ctrl+C again to create a third window. You can now run three programs at the same time and switch between the different windows using Ctrl+0 (for the first window you created), Ctrl+1 (for the second), Ctrl+2....etc.
Read up on the man page for more info: man screen
If you don't have screen installed you should be able to grab it from your distribution as it's a very common tool.
thansk for the tip hw-tph but that didn't work for my purposes. It kind of behaves like &. Somehow my app only works when being started from the console.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.