O'Reilly logo

tmux by Brian P. Hogan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Windows

It’s possible, and very common, to run multiple, simultaneous commands within a tmux session. We can keep these organized with windows, which are similar to tabs in modern graphical terminal emulators or web browsers.

When we create a new tmux session, the environment sets up an initial window for us. We can create as many as we’d like, and they will persist when we detach and reattach.

Let’s create a new session that has two windows. The first window will have our normal prompt, and the second window will run the top command. We’ll create a named session called “windows,” like this:

 
$ ​tmux new -s windows -n shell

By using the -n flag, we tell tmux to name the first window so we can identify it easily.

Now let’s add ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required