You are not logged in.

#1 2007-02-06 21:38:41

no24
Member
Registered: 2007-01-31
Posts: 62

Running programs from terminal emulator

Just wondering, certain programs (i.e. firefox) can be executed from the command line and open on their own, returning the command line to the prompt. other programs remain tied to the terminal, so that you can't close the terminal without closing the program also as a result. i tried to find an answer in the forums and around,  but is there an argument or setting to use that allows programs to be executed from the command line without being "stuck" in it? Thanks

Offline

#2 2007-02-06 21:51:12

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Running programs from terminal emulator

Yes, just add "&" to the end of the command then run "disown":

$ firefox http://bbs.archlinux.org/ &
[x] xxxxx
$ disown

The & makes the command run in the background, disown tells the shell to ignore the process, so it won't close when the terminal window closes.

Last edited by skymt (2007-02-06 21:54:17)

Offline

#3 2007-02-06 22:33:35

no24
Member
Registered: 2007-01-31
Posts: 62

Re: Running programs from terminal emulator

oh okay thanks. seems like a pain =T

Offline

#4 2007-02-06 22:35:24

no24
Member
Registered: 2007-01-31
Posts: 62

Re: Running programs from terminal emulator

at least you can type

$ command & disown

in one line

Last edited by no24 (2007-02-06 22:35:41)

Offline

#5 2007-02-06 23:29:12

Stalwart
Member
From: Latvia, Riga
Registered: 2005-10-18
Posts: 445
Website

Re: Running programs from terminal emulator

$ command &
ctrl+d

When you quit shell (not just close term) programs in background keep running


IRC: Stalwart @ FreeNode
Skype ID: thestalwart
WeeChat-devel nightly packages for i686

Offline

#6 2007-02-06 23:40:11

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: Running programs from terminal emulator

i use a .bashrc function, maybe you'll find it useful

quiet (){
  nohup $1 &>/dev/null &
}

just paste that in your.bashrc and now you can execute things like quiet firefox (:

Offline

#7 2007-02-07 00:13:04

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: Running programs from terminal emulator

oh, almost forgot, add this also so it autocompletes
complete -A command quiet

Offline

#8 2007-02-07 00:15:50

no24
Member
Registered: 2007-01-31
Posts: 62

Re: Running programs from terminal emulator

awesome thank you

Offline

Board footer

Powered by FluxBB