Complete tmux Tutorial

HackerSploit · Intermediate ·🔐 Cybersecurity ·6y ago

Key Takeaways

The video provides a comprehensive tutorial on using tmux, a terminal multiplexer for Unix-like operating systems, covering topics such as managing windows, panes, and sessions. It demonstrates how to create and manage tmux sessions, panes, and windows, and how to customize tmux to individual workflows.

Full Transcript

hey guys hackies floyd here back again with another video and in this video i'm going to be showing you how to get good with tmux because a lot of the feedback i received from the previous video that are actually covered how to use teamworks to a basic level uh were you know really requesting me to actually make a follow-up video where i cover everything you need to know to be competent or proficient with tmox and to get the job done so to say um so this video is going to be focused around that i'll be covering everything that i think is important and of course after that you will be in a point where you can actually use uh tmux comfortably but if you want to do anything else uh you can definitely check how to do that on your own this video is focused on the essentials all right so first of all i'm i'm going to talk about sessions all right so bear with me as i create our first session the first thing you want to do before you do anything else is if you're running this on parrot os or kali linux you need to make sure you have tmox installed so again you can use your aptitude package manager so sudo apt install and i'm going to tmux now i already have tmux installed so i really don't need to worry about that and for the for the duration of this video i'm going to be using a utility called screen key so that you guys can actually see what i'm going to be typing so i'll just disable that for now the first thing we want to do when we want to create a new session and i'm not going to give it a name or anything we just want to get into tmox because we type in tmox right and now that we're in tmox again you're going to get the highlighted green bar at the bottom that gives you all your open windows now in our case we only have uh one window which is a label from zero all the way to as many windows as you want that's something to take into consideration is that the window labeling starts from zero and moves on uh ford uh numerically uh you then have the the name of the window which you can actually assign and i'll get to that in a second and the asterisk actually specifies uh what window is selected so if you create more than one window you can actually move uh between them you know so that would make that a very good um indicator of what window you're on all right so the first thing i'm going to do is let me just enable a screen key and let's talk about new pains and how to create them and how to switch between pains so pains are slightly different right so if you have ever used something like terminator you know that you can split your terminal window into two sides into four sides as many sides or as many panes as you want and you can perform multiple tasks within those panes within the same window all right so it's not uh it's not quite the same as opening another window all right so the first thing we want to do to create a new pane we hit a control b and we use the percentage sign right or the percentage symbol right and of course that is done by invoking the shift key and as you can see that creates a new pane on to our right now if you want to switch between the pins we type in control b and we use the your navigational keys or your directional keys so now in my case if i wanted to move to the left i would use ctrl b and left if i wanted to move to the right so on and so forth you get the idea it's quite intuitive so again i can hit ctrl p and i want to go to the left and let's say i want to run h stop here i can run edge stop there if i want to go to the next one the next pane i can do that as well and i can do essentially all that i want here right so there's tons of stuff that i can you there's tons of stuff you can do within two panes and of course if you want to create a new one we can do that as well um so what i'm going to do is i'm going to say control b but instead of creating a third pane a third vertical pane to my right i'm going to create a uh pain on my bottom of the second pin right over here the one that's i'm currently active in here so what i'll do is let me just hit ctrl v and we're going to use the quotation mark and that creates a pain at the bottom as opposed to one on your right that stands vertically um so you can see you can create as many as you want so i can create another one at the bottom here and you get the idea it's fairly simple to understand what panes are so again if i want to exit i just hit exit in the ones that i want to close down so i can say exit and uh if i want to go to the next one i can get into that in it and then just hit um exit like so and that closes out the panes for me so that is creating pains it's very very simple use control and b and of course you then use the percentage sign or the percentage symbol to create a vertical pane and if you want to create a horizontal pane you use the quotation mark so that's control b and the quotation marks all right now if let's talk about windows all right so windows are you can think of them as entirely new windows where you can do whatever you want and you can sort them in regards to the task that you're trying to achieve in each of them right and in each of them you can create as many panes as you want so you really have a lot that you can do in terms of multitasking here so in in our case let's create a new window we do that by typing in control b and c and that creates a new window and as you can see uh the new window is going to be labeled after zero as one that makes logical sense right and it's going to have a name as bash and that's because we're currently in the bash shell and it's currently highlighted with the asterisk that means we are currently in window one now if i wanted to switch back into windows 0 i would type in control b and 0 all right and as you can see the asterisk is now selected here so just to show you how that works again if i run something like h top in windows 0 and i go to window 1 which is control b and 1 you can see we have nothing there but if i switch back to windows 0 we still have htop running so that it actually shows you that it's moving it's moving around as we expected all right so if we want to actually rename a particular window which is quite useful so let's say in this window i want to work with git i'm going to be doing all my commits and stuff from this particular window i would hit control b and then i would hit the the comma right over here and then i'll rename it to let's say git and i hit enter that's going to rename it there and if i wanted to rename the second window i'll just go into window one and i can hit a control b rename and let's say i'm going to be working with docker in the second window and i can just hit enter and now we have a bit of context as to what we're going to be using these windows for and of course within these windows we can create we can create panes and we can do multiple things within a single window so hopefully that makes sense um now if we want to actually exit from a window or close down a window all we need to do is type in exit right and that closes that window and as you can see right now we only have one window open which is the get window all right so that's fairly simple to understand now let's talk about sessions which is where the true power of tmark starts to shine through right so the reason i recommend dmacc so much especially for system administrators is because it handles uh it handles the terminals uh or the uh your processes in the form of sessions so uh when you start up tmux you start up a teamwork session and uh the the great thing about sessions is that it preserves your state or whatever process that's actually running within that window or within that session so if i was to lose connection to a server that i was connected to through ssh and i was using tmox and for whatever reason let's say i had a connection drop that means if i ssh back into that server and i reloaded or attached to my tmark session it would i would be exactly where i left it off and if i was running a process that process would not be terminated because i actually i lost the connection to that particular terminal instead it continues on in the background so that's the the great thing about it so uh to detach a session that you're working on uh you can do that by typing in control b and d and that will detach it as you can see now we're back into uh we're back into our normal terminal and you can see it is detached from session zero now when you have tmox running and you have team accessions running in the background you can view the sessions running in the background by typing in tmox ls and that tells you uh tmox0 by the way we can rename this session that's quite awesome as well and then it gives you a summary of how many windows you have open within that dmox session and when and when it was created so it gives you a bit of important context as to what you have running within that session so that's currently running in the background so if i want to reattach to that section to that particular session i'll just hit tmax and i'll say attach and i specify the target session and then the name of that session in this case the name is zero because we haven't specified it and i hit zero and it takes us into that session so let me just show you how this would work so let's say i want to type in git config and i say global and let's list my global configuration here all right so i've outputted some data and i just want to show you that it actually preserves the state so again control b and d to detach that and uh t marks ls you can see that that's currently running if again i specified t mux attached uh to the to session 0 you can see that the exact state is preserved so i hope that makes sense so i'm just gonna detach from that session and let's talk about um renaming sessions right so tmox ls you can see it's currently named as zero so if i want to rename this session i would type in tmox rename session and i'll specify uh the target which is going to be uh session zero and i'll provide the name here so i wanted to call it git i hit enter if i say tmox ls now you can see uh it actually tells us the session name is called get all right so let's say we wanted to only work with git within that session and we want to create a new session right but instead of going directly into that session we also want to give it a name before we go into the session so we say tmox and we say new we specify this is going to be a session and then we say uh let's say i want to work on docker in that session so now it's taken us into the docker session and again if we detach and we list the sessions that we have running you can now see we have git and the docker sessions all running concurrently running their own processes and we can switch between them as much as we want and again as i said uh these sessions will be preserved until the system reboots so that's something to keep into mind as well or to keep in mind as well all right so that's essentially how to use tmark sessions and you can create as many as you want let's talk about the final uh step which is actually deleting sessions or killing sessions that you're not using so if i say dmox i can say kill session and i specify the target which is going to in this case let's start let's start off with the docker session and i hit enter if i list this you can see it it actually killed the docker session and we can repeat this for the git session like so and there we are and if we list uh sorry about that if we list the currency mark sessions you can see we have none running so uh that was a comprehensive video on all the essentials that you will need to become competent uh and comfortable within tmox i haven't covered anything extensive about it but i'm sure depending on your own workflow uh you can customize tmux to your own liking and uh yeah so that's pretty much gonna that's gonna be it for this video guys let me know what you think i would love to hear your feedback in the comments section and i'll be seeing you in the next video peace guys

Original Description

This video is aimed at demonstrating and explaining how to use tmux more efficiently. This video covers everything from managing windows and panes to sessions in tmux. tmux is a terminal multiplexer for Unix-like operating systems. It allows multiple terminal sessions to be accessed simultaneously in a single window. It is useful for running more than one command-line program at the same time. 📈 SUPPORT US: Patreon: https://www.patreon.com/hackersploit Merchandise: https://teespring.com/en-GB/stores/hackersploitofficial SOCIAL NETWORKS: Reddit: https://www.reddit.com/r/HackerSploit/ Twitter: https://twitter.com/HackerSploit Instagram: https://www.instagram.com/hackersploit/ LinkedIn: https://www.linkedin.com/company/18713892 WHERE YOU CAN FIND US ONLINE: Blog: https://hsploit.com/ HackerSploit - Open Source Cybersecurity Training: https://hackersploit.org/ HackerSploit Academy: https://www.hackersploit.academy HackerSploit Discord: https://discord.gg/j3dH7tK LISTEN TO THE CYBERTALK PODCAST: Spotify: https://open.spotify.com/show/6j0RhRiofxkt39AskIpwP7 We hope you enjoyed the video and found value in the content. We value your feedback. If you have any questions or suggestions feel free to post them in the comments section or contact us directly via our social platforms. Thanks for watching! Благодарю за просмотр! Kiitos katsomisesta Danke fürs Zuschauen! 感谢您观看 Merci d'avoir regardé Obrigado por assistir دیکھنے کے لیے شکریہ देखने के लिए धन्यवाद Grazie per la visione Gracias por ver شكرا للمشاهدة #tmux
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from HackerSploit · HackerSploit · 0 of 60

← Previous Next →
1 How To Install Kali Linux 2.0 On Virtual Box
How To Install Kali Linux 2.0 On Virtual Box
HackerSploit
2 100 Subscriber Q&A! - How I Learned Ethical Hacking
100 Subscriber Q&A! - How I Learned Ethical Hacking
HackerSploit
3 BlackArch Linux Review - Better Than Kali Linux?
BlackArch Linux Review - Better Than Kali Linux?
HackerSploit
4 How to Access the Deep Web Safely | Deep Web Starter Guide 1.0
How to Access the Deep Web Safely | Deep Web Starter Guide 1.0
HackerSploit
5 Wireshark Tutorial for Beginners - Installation
Wireshark Tutorial for Beginners - Installation
HackerSploit
6 Wireshark Tutorial for Beginners - Overview of the environment
Wireshark Tutorial for Beginners - Overview of the environment
HackerSploit
7 Wireshark Tutorial for Beginners - Capture options
Wireshark Tutorial for Beginners - Capture options
HackerSploit
8 Wireshark Tutorial for Beginners - Filters
Wireshark Tutorial for Beginners - Filters
HackerSploit
9 Complete Ethical Hacking Course - Become a Hacker Today - #1 Hacking Terminology
Complete Ethical Hacking Course - Become a Hacker Today - #1 Hacking Terminology
HackerSploit
10 Complete Ethical Hacking Course #2 - Installing Kali Linux
Complete Ethical Hacking Course #2 - Installing Kali Linux
HackerSploit
11 Parrot OS 3.5 Review | The Best Kali Linux Alternative
Parrot OS 3.5 Review | The Best Kali Linux Alternative
HackerSploit
12 Nmap Tutorial For Beginners - 1 - What is Nmap?
Nmap Tutorial For Beginners - 1 - What is Nmap?
HackerSploit
13 Katoolin | How To Install Pentesting Tools On Any Linux Distro
Katoolin | How To Install Pentesting Tools On Any Linux Distro
HackerSploit
14 Nmap Tutorial For Beginners - 2 - Advanced Scanning
Nmap Tutorial For Beginners - 2 - Advanced Scanning
HackerSploit
15 Nmap Tutorial For Beginners - 3 - Aggressive Scanning
Nmap Tutorial For Beginners - 3 - Aggressive Scanning
HackerSploit
16 Zenmap Tutorial For Beginners
Zenmap Tutorial For Beginners
HackerSploit
17 How To Setup Proxychains In Kali Linux - #1 - Stay Anonymous
How To Setup Proxychains In Kali Linux - #1 - Stay Anonymous
HackerSploit
18 How To Setup Proxychains In Kali Linux - #2 - Change Your IP
How To Setup Proxychains In Kali Linux - #2 - Change Your IP
HackerSploit
19 How To Change Mac Address In Kali Linux | Macchanger
How To Change Mac Address In Kali Linux | Macchanger
HackerSploit
20 How To Setup And Use anonsurf On Kali Linux | Stay Anonymous
How To Setup And Use anonsurf On Kali Linux | Stay Anonymous
HackerSploit
21 Ubuntu 17.04 "Zesty Zapus" Review - Bye Unity
Ubuntu 17.04 "Zesty Zapus" Review - Bye Unity
HackerSploit
22 VPN And DNS For Beginners | Kali Linux
VPN And DNS For Beginners | Kali Linux
HackerSploit
23 Tails OS Installation And Review - Access The Deep Web/Dark Net
Tails OS Installation And Review - Access The Deep Web/Dark Net
HackerSploit
24 Steganography Tutorial - Hide Messages In Images
Steganography Tutorial - Hide Messages In Images
HackerSploit
25 The Lazy Script - Kali Linux 2017.1 - Automate Penetration Testing!
The Lazy Script - Kali Linux 2017.1 - Automate Penetration Testing!
HackerSploit
26 Best Linux Distributions For Penetration Testing
Best Linux Distributions For Penetration Testing
HackerSploit
27 Netcat Tutorial - The Swiss Army Knife Of Networking - Reverse Shell
Netcat Tutorial - The Swiss Army Knife Of Networking - Reverse Shell
HackerSploit
28 Gaining Access - Web Server Hacking - Metasploitable - #1
Gaining Access - Web Server Hacking - Metasploitable - #1
HackerSploit
29 Web Server Hacking - FTP Backdoor Command Execution With Metasploit - #2
Web Server Hacking - FTP Backdoor Command Execution With Metasploit - #2
HackerSploit
30 How To Install Kali Linux On VMware  - Complete Guide 2018
How To Install Kali Linux On VMware - Complete Guide 2018
HackerSploit
31 Q&A #1 - Best Cyber-security Certifications?
Q&A #1 - Best Cyber-security Certifications?
HackerSploit
32 Terminator - Kali Linux - Multiple Terminals
Terminator - Kali Linux - Multiple Terminals
HackerSploit
33 Shodan Search Engine Tutorial - Access Routers,Servers,Webcams + Install CLI
Shodan Search Engine Tutorial - Access Routers,Servers,Webcams + Install CLI
HackerSploit
34 Q&A #2 - Mr Robot?
Q&A #2 - Mr Robot?
HackerSploit
35 Metasploit Community Web GUI  - Installation And Overview
Metasploit Community Web GUI - Installation And Overview
HackerSploit
36 Linux Expl0rer - Forensics Toolbox - Installation & Configuration
Linux Expl0rer - Forensics Toolbox - Installation & Configuration
HackerSploit
37 QuasarRAT - The Best Windows RAT? - Remote Administration Tool for Windows
QuasarRAT - The Best Windows RAT? - Remote Administration Tool for Windows
HackerSploit
38 Metasploit For Beginners - #1 - The Basics - Modules, Exploits & Payloads
Metasploit For Beginners - #1 - The Basics - Modules, Exploits & Payloads
HackerSploit
39 Metasploit For Beginners - #2 - Understanding Metasploit Modules
Metasploit For Beginners - #2 - Understanding Metasploit Modules
HackerSploit
40 Kali Linux Quick Tips - #1 - Adding a non-root user
Kali Linux Quick Tips - #1 - Adding a non-root user
HackerSploit
41 Metasploit For Beginners - #3 - Information Gathering - Auxiliary Scanners
Metasploit For Beginners - #3 - Information Gathering - Auxiliary Scanners
HackerSploit
42 Spectre Meltdown Vulnerability  - How To Check Your System
Spectre Meltdown Vulnerability - How To Check Your System
HackerSploit
43 Metasploit For Beginners - #4 - Basic Exploitation
Metasploit For Beginners - #4 - Basic Exploitation
HackerSploit
44 ARP Spoofing With arpspoof - MITM
ARP Spoofing With arpspoof - MITM
HackerSploit
45 WordPress Vulnerability Scanning With WPScan
WordPress Vulnerability Scanning With WPScan
HackerSploit
46 Generating A PHP Backdoor with weevely
Generating A PHP Backdoor with weevely
HackerSploit
47 Nikto Web Vulnerability Scanner - Web Penetration Testing - #1
Nikto Web Vulnerability Scanner - Web Penetration Testing - #1
HackerSploit
48 How To Install Kali Linux On Windows 10 - Windows Subsystem For Linux
How To Install Kali Linux On Windows 10 - Windows Subsystem For Linux
HackerSploit
49 Stacer - System Optimizer And Monitoring Tool For Linux
Stacer - System Optimizer And Monitoring Tool For Linux
HackerSploit
50 Kali Linux 2018.1 - Kernel Updates & Patches
Kali Linux 2018.1 - Kernel Updates & Patches
HackerSploit
51 MITM With Ettercap - ARP Poisoning
MITM With Ettercap - ARP Poisoning
HackerSploit
52 Password Cracking With John The Ripper - RAR/ZIP & Linux Passwords
Password Cracking With John The Ripper - RAR/ZIP & Linux Passwords
HackerSploit
53 How To Detect Rootkits On Kali Linux - chkrootkit & rkhunter
How To Detect Rootkits On Kali Linux - chkrootkit & rkhunter
HackerSploit
54 Channel Updates - How To Post Questions & Video Suggestions
Channel Updates - How To Post Questions & Video Suggestions
HackerSploit
55 Web App Penetration Testing - #1 - Setting Up Burp Suite
Web App Penetration Testing - #1 - Setting Up Burp Suite
HackerSploit
56 Web App Penetration Testing - #2 - Spidering & DVWA
Web App Penetration Testing - #2 - Spidering & DVWA
HackerSploit
57 Cl0neMast3r - GitHub Repository Cloning Tool
Cl0neMast3r - GitHub Repository Cloning Tool
HackerSploit
58 Kali Linux On Windows 10 Official - WSL - Installation & Configuration
Kali Linux On Windows 10 Official - WSL - Installation & Configuration
HackerSploit
59 DoS/DDoS Protection - How To Enable ICMP, UDP & TCP Flood Filtering
DoS/DDoS Protection - How To Enable ICMP, UDP & TCP Flood Filtering
HackerSploit
60 Web App Penetration Testing - #3 - Brute Force With Burp Suite
Web App Penetration Testing - #3 - Brute Force With Burp Suite
HackerSploit

This video tutorial covers the basics of using tmux, including creating and managing sessions, panes, and windows. It also demonstrates how to customize tmux to individual workflows and how to use the dmux command to manage sessions.

Key Takeaways
  1. Create a new tmux session using `tmux new-session`
  2. Create a new pane using `Ctrl+B %`
  3. Switch between panes using `Ctrl+B <directional key>`
  4. Create a new window using `Ctrl+B c`
  5. Rename a window using `Ctrl+B ,`
  6. Exit a window using `exit`
  7. Start a new tmux session using `tmux new-session`
  8. Detach a tmux session using `tmux detach`
  9. List tmux sessions using `tmux ls`
  10. Rename a tmux session using `tmux rename-session`
💡 tmux allows multiple terminal sessions to be accessed simultaneously, making it a powerful tool for managing complex workflows.

Related Reads

📰
SQL Injection Is Not Dead: Why an Old Vulnerability Still Breaks Modern Applications
SQL injection remains a significant threat to modern applications despite being an old vulnerability, and understanding its impact is crucial for cybersecurity
Medium · Cybersecurity
📰
TryHackMe: Support Walkthrough
Learn to exploit vulnerabilities in a TryHackMe support system through a step-by-step walkthrough, improving your cybersecurity skills
Medium · Cybersecurity
📰
Phase One: Getting Situational Awareness Right
Learn how to begin Active Directory penetration tests with situational awareness and environmental context to improve cybersecurity
Medium · Cybersecurity
📰
How to Detect Unauthorized Devices on Your Network with Python (A Practical Scapy Tutorial)
Learn to detect unauthorized devices on your network using Python and Scapy, enhancing your network security skills
Medium · Cybersecurity
Up next
Stop Hackers Getting Into Your Website By Updating Old Plugins
Josiah Roche — Google Ads + SEO Training
Watch →