πŸ‘¨β€πŸ’»
Jawad's Notes
  • πŸ‘¨β€πŸ«INFOSEC
    • πŸ•ΈοΈWeb
      • Burp Suite: Setting Foxyproxy
      • XSS
      • Wappalyzer
      • Directory Traversal
      • LFI
        • PHP Wrappers
        • RFI
      • Reverse Shell
        • Command Injection Quick Tips
      • File Upload
      • WPScan
      • SQL Injection
        • Schemas
        • SQLmap
        • MSSQL
        • MySQL
        • PostgreSQL
    • πŸ”§Tools
      • Whois
      • DNSRecon
      • DNSenum
      • nslookup
      • Netcat
        • Powercat
      • Nmap
        • Nmap Scripting Engine
        • Test-NetConnection
        • Grep
      • Server Message Block (SMB)
      • SNMP
      • SMTP
      • ExifTool
      • Search Engine Hacking
      • Source Control Hacking
      • Nessus
      • Canarytokens
      • Qualys SSL Server Test
      • Security Headers
      • theHarvester
      • Shodan
      • Gobuster
        • Dirb
      • Searchsploit
      • Password Cracking
        • Hashcat
        • John The Ripper
        • Hydra
        • hashID
        • CPU vs GPU
    • 🐧Linux
      • Symbols
      • cat
      • curl
      • openvpn
      • tcpdump
      • Remote Desktop
      • SmbShare
      • Tmux
      • Convert Windows-style line endings (CRLF) to Unix-style (LF)
      • SSH
    • πŸ–₯️Macros in Office
    • 🍎Enhancing Your MacOS Terminal Experience
    • 🚩CTF
      • SQL Injection
        • WHERE clause allowing retrieval of hidden data
        • Allowing login bypass
        • UNION attack, determining the number of columns returned by the query
        • UNION attack, finding a column containing text
        • UNION attack, retrieving data from other tables
        • UNION attack, retrieving multiple values in a single column
        • Querying the database type and version on Oracle
Powered by GitBook
On this page
  • Tmux Keybindings
  • Tmux Configuration File
  1. INFOSEC
  2. Linux

Tmux

Tmux is a powerful terminal multiplexer that allows users to manage multiple terminal sessions effectively. It's designed to help users switch easily between several programs in one terminal, detach them (they keep running in the background), and then reattach them to a different terminal. Customizing tmux to suit individual workflow preferences can significantly enhance productivity. Below are detailed examples of key tmux commands (keybindings) and insights into configuring tmux through its configuration file.

Tmux Keybindings

Tmux commands typically start with a "prefix key", which is Ctrl-b by default, followed by a command key. Here are some commonly used tmux keybindings:

  • Creating and Managing Windows and Panes:

    • Ctrl-b c: Creates a new window within tmux.

    • Ctrl-b ,: Rename the current window; useful for keeping track of multiple windows.

    • Ctrl-b %: Splits the current pane vertically into two panes.

    • Ctrl-b ": Splits the current pane horizontally.

    • Ctrl-b o: Cycles through panes within the current window.

    • Ctrl-b x: Closes the current pane.

  • Navigating Between Windows:

    • Ctrl-b n: Moves to the next window.

    • Ctrl-b p: Moves to the previous window.

    • Ctrl-b [0-9]: Switches to a window by its index number.

  • Detaching and Re-attaching:

    • Ctrl-b d: Detaches the current session (leaving it running in the background).

    • Reattach to a session with tmux attach-session -t [session name].

  • Scrolling and Copy Mode:

    • Ctrl-b [: Enters the copy mode, which allows for scrolling and copying text. You can navigate using the arrow keys or vim-like keys (j, k, h, l).

Tmux Configuration File

The tmux configuration file (~/.tmux.conf) allows users to set default options, keybindings, and other preferences that customize the tmux environment. Here are examples of what you can define in this file:

  • Changing the Prefix Key:

    • unbind C-b: Removes the default binding for Ctrl-b.

    • set-option -g prefix C-a: Changes the prefix to Ctrl-a.

  • Improving Pane Navigation:

    • bind-key -n C-h select-pane -L: Move to the left pane using Ctrl-h.

    • bind-key -n C-j select-pane -D: Move to the bottom pane using Ctrl-j.

    • bind-key -n C-k select-pane -U: Move to the top pane using Ctrl-k.

    • bind-key -n C-l select-pane -R: Move to the right pane using Ctrl-l.

  • Automatically Renaming Windows:

    • set-option -g automatic-rename on: Automatically renames windows to reflect the current application in use.

After editing ~/.tmux.conf, you can apply the changes by either restarting tmux or by executing tmux source-file ~/.tmux.conf within a tmux session.

Youtube tutorial

I found the following Youtube video (if you can ignore its clickbait title :-) very useful for a quick demonstration of Tmux's main features.

References:

PreviousSmbShareNextConvert Windows-style line endings (CRLF) to Unix-style (LF)

Last updated 1 year ago

πŸ‘¨β€πŸ«
🐧
Tmux Cheatsheet