# Using Tmux

Terminal multiplexers, like `tmux` or `Screen`, are great utilities for expanding a standard Linux terminal's features, like having multiple windows within one terminal and jumping between them. Let's see some examples of using `tmux`, which is the more common of the two. If `tmux` is not present on our Linux system, we can install it with the following command:

<figure><img src="https://55426363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpkdwDJIuvdv3ukF6DFYY%2Fuploads%2FjH8egjBHNJzNbLFvUkIb%2Fimage.png?alt=media&#x26;token=302b237b-1028-478c-90bc-14ca0cb04c29" alt=""><figcaption></figcaption></figure>

Once we have `tmux`, we can start it by entering `tmux` as our command:

<figure><img src="https://55426363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpkdwDJIuvdv3ukF6DFYY%2Fuploads%2FLjEnRoi4a6JGJuE0AQiT%2Fimage.png?alt=media&#x26;token=b97c9941-ba68-4ae9-a570-9345dc7fd433" alt=""><figcaption></figcaption></figure>

The default key to input `tmux` commands prefix is `[CTRL + B]`. In order to open a new window in `tmux`, we can hit the prefix 'i.e. `[CTRL + B]`' and then hit `C`:

<figure><img src="https://55426363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpkdwDJIuvdv3ukF6DFYY%2Fuploads%2FBD198b9SRZqFgTHM6gzq%2Fimage.png?alt=media&#x26;token=0fcb9ed8-6a42-4e2c-b07a-8c1fe6d4fade" alt=""><figcaption></figcaption></figure>

We see the numbered windows at the bottom. We can switch to each window by hitting the prefix and then inputting the window number, like `0` or `1`. We can also split a window vertically into panes by hitting the prefix and then `[SHIFT + %]`:

<figure><img src="https://55426363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpkdwDJIuvdv3ukF6DFYY%2Fuploads%2FsLqZurYQyNuiA4KhES1p%2Fimage.png?alt=media&#x26;token=4786a047-4d9a-4515-aea5-5427bf5ec2bc" alt=""><figcaption></figcaption></figure>

We can also split into horizontal panes by hitting the prefix and then `[SHIFT + "]`:

<figure><img src="https://55426363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpkdwDJIuvdv3ukF6DFYY%2Fuploads%2Fu9991b5yPQ5J94W7P34C%2Fimage.png?alt=media&#x26;token=23f0a811-d716-4adc-a404-53f7d57b96c7" alt=""><figcaption></figcaption></figure>

We can switch between panes by hitting the prefix and then the `left` or `right` arrows for horizontal switching or the `up` or `down` arrows for vertical switching. The commands above cover some basic `tmux` usage. It is a powerful tool and can be used for many things, including logging, which is very important during any technical engagement.&#x20;

{% embed url="<https://tmuxcheatsheet.com/>" %}

This [Introduction to tmux](https://www.youtube.com/watch?v=Lqehvpe_djs) video by `ippsec` is worth your time.

{% embed url="<https://www.youtube.com/watch?v=Lqehvpe_djs>" %}
