LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2010, 11:22 AM   #1
alpha_lt
Member
 
Registered: Jul 2009
Location: Denmark
Distribution: Fedora
Posts: 95

Rep: Reputation: 15
Loosing jobs list after quitting terminal


Hello,

I think question is too simple, but its too hard to find any info on it. Question is just simple as:
I open ssh terminal into my server and run some command using 'cp /path/file /other/path/file &'. And off course this runs as background job and I can list it using jobs command. This is very good. Then I close my terminal using 'exit' and then re-enter it again using ssh and I can see the same copy job with 'ps aux', but it no more listed with 'jobs' command. How can I bring this job back to foreground and control with 'jobs' command ?
 
Old 01-30-2010, 11:41 AM   #2
++nick++
Member
 
Registered: Dec 2008
Location: Bellevue,WA
Distribution: RHEL 5 , Fedora ,Sabayon,Solaris,Vmware,AWS
Posts: 107

Rep: Reputation: 18
Hello,

I tried your scenario in my linux computer locally , I experienced the same issue that you have reported.
Then i checked the man page of "jobs" command , it clearly stated that,

"jobs - display status of jobs in the current session"

Will check more on this ,BTW , as you can find the PID of the cp command using ps -aux command , you could do whatever you want with it.
 
Old 01-30-2010, 11:46 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Check out "screen". It's a virtual terminal system that will let you detach and reattach to the shell instances running in it, among other things.
 
Old 01-30-2010, 11:48 AM   #4
alpha_lt
Member
 
Registered: Jul 2009
Location: Denmark
Distribution: Fedora
Posts: 95

Original Poster
Rep: Reputation: 15
How can I for example bring proccess to foreground by its PID ?
 
Old 01-30-2010, 11:53 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I'm not sure if it's even possible to directly import a process into a running terminal. At least I've never heard of anything like that.

Here's a page that explains the basics on how to use screen though.

http://www.rackaid.com/resources/lin...al-and-how-to/

Launch your command inside a screen terminal and you can get back to it any time.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show the list of stopped and background jobs fakhrul Linux - General 6 01-09-2012 09:58 AM
Terminal : How to list previous commands? concoran Linux - Newbie 6 07-12-2011 09:00 AM
What code in the terminal shows you the list of sockets? JBailey742 Linux - General 3 02-20-2008 09:16 PM
yum list too big for terminal loverofpizza Linux - Newbie 5 08-18-2005 02:34 PM
Quitting X lokee Linux - Newbie 3 02-03-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:48 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