# TMUX Usage

### Commands

```bash
####################### SESSIONS ###################################

# Create a new session
tmux new -s OSCP

# Run TMUX commands (Set Env Var)
Ctrl+A and :
setenv YOUR_VAR_NAME desired_value

# Prefix Key -> (Ctrl+A) Key combination before a command to tell tmux that the following keystroke is a tmux command, not regular input for the shel

######################## WINDOWS ####################################

# Create a new window
Ctrl+A and c

# Swap between windows
Ctrl+A and 1/2/3 
Ctrl+A and n # Next
Ctrl+A and p # Prev

# Rename Current Window
Ctrl+A and ,

# List Windows and Swap between them
Ctrl+A and w

# Close Current Window
exit
Ctrl+D

######################## PANES ######################################

# Split the current pane with a vertical line
Ctrl+A and %

# Split the current with a horizontal line
Ctrl+A and \"

# Toggle Zoom on a pane (Rerun to get back all panes)
Ctrl+A and z

# Switch to pane to the direction
Ctrl+A and ->
Ctrl+A and <-
Ctrl+A and Up
Ctrl+A and Down

# Swap Panes
Ctrl+A and { # Swap to the one to the left
Ctrl+A and } # Swap to the one to the right

# Change Layouts
Ctrl+A and SpaceBar

# Misc
Ctrl + A A # Start of Line
Ctrl + E # End of Line
Alt + . # Cycle through prev command args
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gokulkarthik.gitbook.io/pentesting-checklist/others/miscellaneous/tmux-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
