is it possible to open a new shell from a shell and switch between them?

15,798

Solution 1

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.

Solution 2

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.

Share:
15,798

Related videos on Youtube

DCIndieDev
Author by

DCIndieDev

Updated on September 17, 2022

Comments

  • DCIndieDev
    DCIndieDev over 1 year

    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?

  • David Oneill
    David Oneill over 13 years
    +1 Screen is one of the more useful programs in existence.
  • Benjamin Bannier
    Benjamin Bannier over 13 years
    bash has suspend, too.
  • Nethan
    Nethan over 13 years
    @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