LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-03-2009, 03:35 PM   #1
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Rep: Reputation: 30
Is it possible to open a second shell..


I'm running Debian with no desktop and at the moment no network connection (so I can't ssh). A drive recovery program is running in the shell and likely will be for the next 8 to 16 hours by the look of it.

Is there some keyboard shortcut I can use to open a second shell at the terminal while this one continues to run?

Or get a second login prompt... whatever it takes.
 
Old 12-03-2009, 03:43 PM   #2
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30
Nevermind, I found an alternate solution. I can pause the current job using ctrl+z and resume it later (for reference: resume paused by using "jobs" to list stopped jobs and "fg %#" where # is the number of the stopped job I want to resume).
 
Old 12-03-2009, 03:43 PM   #3
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Normally 'ctrl+alt+F2' or F3 or F4 etc. would give a new shell.
 
Old 12-03-2009, 03:44 PM   #4
mk27
Member
 
Registered: Sep 2008
Distribution: fedora, gentoo, ubuntu
Posts: 148

Rep: Reputation: 23
Quote:
Originally Posted by davidstvz View Post
Or get a second login prompt... whatever it takes.
You are in luck. There are in fact 6 "virtual terminals" independent of the graphical desktop. You can access them with alt-ctrl F1-6.

Those are there all the time. If you do have a GUI running, you can go back to it with alt-ctrl-F7.
 
Old 12-03-2009, 03:44 PM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

There are mainly two ways that I know of, first is pressing CTRL-ALT-F2 or F3 or F4, those are all other logins so you can open a second shell. I believe F5 or F7 is reserved for Graphical Login.

You can also send your program that's running to the background using CTRL-Z and type bg at the prompt. That way you stay in you current shell and the program keeps running in the background.

If you want to recall the program the just type
Code:
fg
on the commandline.

Kind regards,

Eric

Last edited by EricTRA; 12-03-2009 at 03:45 PM.
 
Old 12-04-2009, 09:09 AM   #6
pcunix
Member
 
Registered: Dec 2004
Location: MA
Distribution: Various
Posts: 149

Rep: Reputation: 23
Also: chvt 2 is the same as CTRL-ALT-F2

However, if you are in single user mode, neither of those will work. You can get another login, but it how depends on your distro.

Ubuntu Upstart

Newer Ubuntu systems use "Upstart" instead of inittab. For these systems, a simple"start tty2" will do the job. After typing that, you can hold "Alt" and press F2 to login there and of course Alt-F1 will bring you back to where you started.

Centos inittab

Centos and other systems that still use inittab require a different approach. You'd think you could just do "/sbin/mingetty tty2 &", but that won't work. Nor will "/bin/login tty2 &" or trying to start bash with input and output directed to another tty. What WILL work is sulogin: "/sbin/sulogin tty2 &". Switch to Alt-F2, give the root password and you have another terminal to work in.

It's certainly possible that another distro may require another way or may work with something that didn't work on Centos.

(from http://aplawrence.com/Linux/multiple-consoles.html )
 
Old 12-04-2009, 05:41 PM   #7
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,117
Blog Entries: 2

Rep: Reputation: 113Reputation: 113
screen will also give you multiple terminals (even when you run out of the other ones)
 
Old 12-05-2009, 02:43 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
FYI
For those advising <ctrl><alt><Fn>, the <ctrl> is only required while in X; outside X, <alt><Fn> should be sufficient.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell programming - file open arispipis Programming 1 03-09-2008 12:57 AM
bash - how to open a new shell tab infraredgirl Programming 4 03-30-2006 08:23 PM
How to open a program in another shell julian_s Linux - General 1 12-22-2005 04:54 PM
open a URL from shell plisken Linux - General 3 11-10-2005 02:43 AM
What is 'open a shell'? wood Linux - General 5 09-03-2003 11:09 PM


All times are GMT -5. The time now is 03:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration