hey all I am wondering if I can open a shell or new terminal thing from within the terminal in a unix/linux enviroment. Particularly a commandline only one where there is no GUI. Is this doable? how do I do it?
3 Answers
Run screen
(1). It is a terminal multiplexer. This lets you create multiple shells, running under screen, which you can switch between. You can "detach" from screen to get back to the original shell, and "re-attach" to get back access to those shells.
There's also tmux
(1), doing much the same thing. And on some Unices, window
(1) or splitvt
(1). But screen
(1) is the most wide-spread and probably the tool for which you'll most readily find help.
-
+1 Screen is one of the more useful programs in existence. Commented Jan 18, 2011 at 0:51
You can do this in zsh by running suspend
to switch from the second shell to the first, andfg
to switch from the first to the second.
You should be able to do something similar in bash using kill -STOP $$
in place of suspend
.
But GNU screen or tmux would be easier.
-
-
@honk Thanks. Online man pages didn't mention
suspend
, but indeed it's there in bash 3.2. gnu.org/software/bash/manual/html_node/Bash-Builtins.html– MikelCommented Jan 18, 2011 at 3:32
By default there are multiple virtual consoles you can change between in Linux, usually by pressing Alt + one of the function keys, usually F1 through F7. The number of consoles available depends on how the NR_CONSOLES directive was set when your kernel was compiled, it may vary depending on distribution.
If you'd like to fork another shell, simply run the binary, e.g.: /bin/bash
(simply bash will work fine since it's usually in your path). Keep in mind this does not make the old shell available unless you send it to the background or have it run in a screen session.
If you are using a desktop environment and running terminal windows, you can usually map keys to launch more terminal windows from the environment. I know GNOME and KDE have this ability. You can switch between graphical windows with ALT+TAB.
If you tell us your use case scenario we can probably find a more suitable solution.