Buy @ Amazon

Essential Tmux for CKAD or CKA Exam

If you are preparing for CKAD or CKA exam and are new to Tmux (Terminal Multiplexer), this post will help you know everything that is essential to being productive with Vim during your exam.

Tmux is a software that is used to launch and play around with multiple terminals, all visible in a single screen for better productivity. Give it a shot to see how you can get productive. But what do you need for it? Possibly just this video tutorial titled Basic Tmux Tutorial in youtube and then this post for reference.

Basic Tmux Configuration For Personal Comfort

First things first, all Tmux commands begin with a prefix-key, to tell the system that this command is issued to Tmux software. The default prefix for Tmux is Ctrl-b (aka C-b, where C implies Ctrl key in short). This default key is not so comfortable and so we may want to change it to something else for our personal comfort. I would like to change the prefix to Ctrl-z (aka C-z).

Also, scrolling through the panes when the text overflows is hard. I prefer to use mouse under these circumstances for my personal comfort.

Lastly, tmux doesn't support color hilighting with commands like grep etc. For this you need to configure it explicitly.

Let's get these 3 basic said requirements configured for Tmux. Create a tmux configuration in your home folder with the command: "vi ~/.tmux.conf" and copy-paste the content below:

Basic Tmux Keyboard Shortcuts To Remember

{prefix} "  ==> split window horizontally
{prefix} %  ==> split window horizontally
{prefix} {Arrow-Key} ==> switch pane
{prefix} c  ==> create new window
{prefix} p  ==> move to previous window
{prefix} n  ==> move to next window
{prefix} {Page-up-Key} ==> scroll-up the pane within tmux
{prefix} q  ==> to quickly flash pane numbers for easy reference to a particular pane
{Ctrl} d  ==> to exit current pane

Hold {prefix} and use {Arrow-Key} to increase/decrease the size of current pane

You should be good enough with just those to quickly get productive with tmux. Once comfortable, feel free to explore more keyboard shortcuts to get even faster. Happy tmux-ing!