Working with Multiple Terminal Tabs in Ubuntu

Linux users nowadays can perform various operations with programs that have a high-quality user interface. However, there are many reasons to use the Linux command line, the terminal.

  • Through the terminal, you can access many powerful native Linux commands as well as the powerful command-line features of many desktop applications.
  • You can install software in Ubuntu much more easily from the command line than from the graphical installation alternative.
  • You may have seen a lot of online help telling you how to solve a problem from the command line. Regardless of what desktop environment you are using or what version of Linux you are working with, the terminal commands are usually the same.

The easiest way to invoke the terminal is to use the key combination ctrl+alt+t. You will notice that each time you start a new terminal, it opens in a separate window. However, the terminal gives you the option to start new terminal sessions as tabs in the same terminal window. With this tabbed interface, you can increase your productivity similar to using tabs in modern Internet browsers.

Enabling tabs in Terminal

Launch the Terminal and select Preferences from the Edit menu as follows:

Enabling tabs in Terminal

You will be able to see the following Preferences dialog; please make sure that the General tab is selected. From the “Open new terminals in:” drop-down, select Tab. When you click the Close button, your required changes will be confirmed and your Terminal will now be enabled to operate in a tabbed user interface.

Please note that you will be able to see a menu bar at the top of the Terminal or at the top panel of your Linux desktop(in case you have enabled Global Menus).

Terminal preferences

Adding a new tab

In order to add a new Terminal as a tab in the existing Terminal window, please select New Terminal from the Files menu as follows:

Add a Terminal tab

You will be able to see the new tab opened with the previous tab running its session.

Note: If you want to launch a new Terminal window instead of opening it in a tab, click ctrl+alt+t

Launch new terminal tab

When more than one tab is opened in a Terminal, you can add more tabs simply by clicking the plus button located on the upper right side of the tabs. New tabs are opened in the same directory as that of the previous Terminal tab.

Switching among tabs

You can switch from one tab to another in the following ways:

  • Clicking on a specific tab to make it active.
  • Clicking on the down arrow at the right side of the tabs and selecting the tab you want to switch to.
  • All tabs are given a number from 1 to the number of tabs open. The shortcut Alt +[number of the tab] will take you to that tab.

Changing order of tabs

You can use one of the following ways to change the order of your tabs:

  • Right-clicking the selected tab and clicking Move Terminal Left or Move terminal Right from the menu.
  • Dragging a tab left or right.

Please remember that now the tabs will be in the new order and will be assigned new tab numbers. You will use these new numbers to switch among tabs using the Alt+[number of the tab] control.

Change tab order

Closing a tab

You can close a tab in the following ways:

  • Clicking the x button of a tab.
  • Selecting a tab and then clicking the Close tab option from the File menu,

Please remember that your tabs are not saved when you close the terminal window. However, the next time you start the terminal, they will still be displayed as tabs.

Once you learn to work with tabs, you can take advantage of the extra speed and ease of use that the terminal gives you. When you start working in multiple tabs, you’ll see that it’s very easy to add, close, rearrange, and switch tabs to increase performance. In this tutorial, you’ll learn how to open a single window and work in tabs instead of a new terminal for all your operations.