LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-28-2002, 07:02 PM   #1
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Rep: Reputation: 15
put task in backgrond with keystroke


i have been using a motion of ctrl-z, followed by bg, to put tasks in the background. this can be inneficient, and dosent work for some tasks that cant be stopped or they mess up, example: a download. if anyone knows a ctrl-something, or how to set one up to put a task directly in the backround, and avoid stopping it i would greatly appreciate it.
 
Old 01-28-2002, 07:36 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
You can append '&' after the command name it will put the task on background but you'll get all the warnings and errors that the task you are running may throw in your face, so you can redirect the output of it to a file or /dev/null if it's not imporatnt to you. To redirect error channel use as this
[shell]$ command > to_file.txt 2>&1 &

Last edited by neo77777; 01-28-2002 at 07:40 PM.
 
Old 01-28-2002, 08:05 PM   #3
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Original Poster
Rep: Reputation: 15
i know you can just put an & after it, but i am talking about a prog, that i use for a while, and then put in the background, so i can logout or get it out of the way while its doing whatever. ctrl-z and bg does exactly what i want, but it stops the task, i am looking for a ctrl-something to do the same thing as ctrl-z, except put it in the background, instead of stopping it.
 
Old 01-28-2002, 10:24 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
sorry man, I don't have a clue, I understand what you are talking about, and unfortunately there is no answer from me; I've looked over all my UNIX books and I couldn't find it.
 
Old 01-28-2002, 10:35 PM   #5
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Try using the 'disown" command - that might be what your looking for.

List your processes then type ' disown 123 ' ... 123 being your process ID.
 
Old 01-29-2002, 12:45 AM   #6
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Original Poster
Rep: Reputation: 15
that is actually something i didnt know and may be useful, but what i was looking for was a ctrl-something, so you could just do it to the running task. There must be a way to do this, as there is one of these for just about everythign else. ie. ctrl-z - stop, ctrl-c - stop, etc.etc.etc...
 
Old 01-29-2002, 01:29 AM   #7
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Hmm you must be using some window manager I don't know about - never heard of what you're trying to do either..
 
Old 01-29-2002, 01:30 AM   #8
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Original Poster
Rep: Reputation: 15
i am thinking of mainly console applications
 
Old 01-29-2002, 07:58 AM   #9
hanzerik
Member
 
Registered: Jan 2002
Location: Cheyenne Wyoming
Distribution: Debian/Raspbian/Mint
Posts: 717

Rep: Reputation: 32
use screen.
this is what i use for setiathome:
screen /home/hanzerik/setiathome . After I type that i can close my ssh connection and it will stay running. To switch back to that program use screen -r .
 
Old 01-29-2002, 05:20 PM   #10
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by hanzerik
use screen.
this is what i use for setiathome:
screen /home/hanzerik/setiathome . After I type that i can close my ssh connection and it will stay running. To switch back to that program use screen -r .
what about if i am using an app for a while, and then want to put it in the background, thats why i mention the ctrl-something
 
Old 01-29-2002, 05:22 PM   #11
ryanstrayer
Member
 
Registered: Jan 2002
Location: Kansas City
Distribution: RedHat 7.2 Kernel 2.4.17
Posts: 250

Rep: Reputation: 30
Why don't you just leave it up - and switch consoles? That's what I do.. if I'm running something and I want to leave it up, but do other stuff - I'll just switch to tty2 or whatever... that's essentially the best way locally... screen as mentioned above, also works very well, esspecially if you want to resume a session of something from a SSH console or something.

Last edited by ryanstrayer; 01-29-2002 at 05:26 PM.
 
Old 01-29-2002, 06:17 PM   #12
febisfebi
Member
 
Registered: Nov 2001
Location: cheeseland
Distribution: slackware 8.0
Posts: 52

Original Poster
Rep: Reputation: 15
i would be using this mainly remotely. there is a ctrl-z to stop a proccess, what i need to know is if there is a ctrl-something to put it in the background.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Output of 'top' as backgrond Burgin Linux - General 2 06-09-2005 05:18 PM
keystroke logger??? paugros Linux - Security 18 03-24-2005 12:06 PM
keystroke macros squip Programming 1 10-09-2003 12:46 PM
emacs keystroke kev82 Programming 9 07-16-2003 10:15 AM
KDE Splash Backgrond cathodion Linux - Software 3 05-19-2002 04:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration