Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Right now when I start a program from a terminal I can't use that terminal instance again until I close the program.

I am a new user of linux, and I want to know if there is a way to execute a program/application from a terminal without blocking the terminal until the program ends.

share|improve this question
add comment

3 Answers

up vote 26 down vote accepted

You are looking for job control which is supported by most shells. See this article for an introduction. At some point you might also want to read the official documentation for bash which is the default shell in Ubuntu.

In short: To start a job automatically in the background put an & after the program call

$ program &

You can also stop programs with CTRLz and then put them into the background later with bg

$ program
^Z
$ bg

To get them to run in the foreground again use fg.

share|improve this answer
add comment

If job control isn't exactly what you want, look into screen.

Screen controls multiple virtual terminals so you can run multiple programs without them interacting with each other. For example, you can run mocp (a music player), aptitude (a package manager), and vim (a text editor) simultaneously, even though all are interactive programs which treat the terminal as if they had sole access.

This makes it easy to switch from one task to another, such as creating a new terminal within screen to read a manpage – without losing your place elsewhere – flipping back and forth, etc.

share|improve this answer
add comment

In addition to honk's answer, you may find this resource useful. It will teach you a massive amount that will help you out when using a shell.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.