3

I was wondering of there is any method to start a new process or a program from one terminal into other.

What I mean is: Let's say I have to run gedit abc.txt, but I don't want it to block my current terminal window.

Is there a way I can run gedit from one terminal into other terminal window? Or can I use gedit without blocking the current terminal?

3 Answers 3

5

Run gedit as:

gedit file.txt &

The & at the end will cause the process to run in background and you will be able to use the current terminal interactively again.

4
  • It is the recommended solution +1 Apr 14, 2015 at 11:10
  • 3
    Problematic when the terminal is closed.
    – A.B.
    Apr 14, 2015 at 11:12
  • @A.B.: yes, but in this context this is all right as OP mentioned without blocking current terminal, which i think just mean that the Op can use terminal interactively again..
    – heemayl
    Apr 14, 2015 at 11:13
  • @heemayl Yes, alright, I just wanted to point out.
    – A.B.
    Apr 14, 2015 at 11:14
5

You can use this command:

gedit abc.txt & disown

Source

In the bash shell, the disown builtin command is used to remove jobs from the job table, or to mark jobs so that a SIGHUP signal is not sent to them if the parent shell receives it (e.g. if the user logs out).

0

You can use the ability to run in background.

To do it just put & at the end of your command. for example:

$ gedit example.txt &

 [1] 12642

To list all processes in the background use the job command.

 $ jobs

[1]+  Running                 gedit example.txt &

To bring the process to foreground again use the fg command:

$ fg %1

gedit example.txt

where %1 represent the first process in the background. %x means the x process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .