Linux Terminal – Save and Restore Terminal on Reboot

linuxterminalUbuntuxubuntu

Is there a way to save my terminal emulator windows and tabs for when I reboot the computer?

I generally have about 10 or so open tabs at any given time and opening each tab to set up everything after a reboot is relatively long. I would like to at least save the current working directories and name each tab works with so I can be more efficient.

If it helps, I am running Xubuntu 14.04.

Best Answer

The following method does not save the directories upon exit. It uses always the same directories until you change them in "Preferences", although you may have multiple indipendent groups of directories.

We will install "terminator".

These are the step-by-step instructions for three tabs. The steps are the same for any number of tabs.


sudo apt-get install terminator

Alternatively, you can install it with aptitude, or ubuntu software center.

  • Run terminator, f.e. from the "KDE" menu.
  • Right-click on the black screen.
  • Click "Open tab".
  • Then again, right-click on the black screen.
  • Click "Open tab".
  • Then again, right-click on the black screen.
  • Click "Preferences"
  • Click on the "Layouts" tab.
  • Click "Add".
  • Write a name and press ENTER. I will use the name "mylayout" in this procedure. Do NOT click "Save".

You can see on the right pane the words: "Window", "Notebook", "Terminal", "Terminal", "Terminal".


  • Click on the LOWEST of the words "Terminal".
  • Click inside the blank field to the right of "Working directory:".
  • Write the path of the directory which you want to be the first tab; f.e. /a/dir1.
  • Click on the word "Terminal" just above the lowest one.
  • Click inside the blank field to the right of "Working directory:".
  • Write the path of the directory which you want to be the second tab.
  • Click on the HIGHEST of the words "Terminal".
  • Click inside the blank field to the right of "Working directory:".
  • Write the path of the directory which you want to be the third tab.
  • Click "Close".
  • Click the "X" in the upper right corner to close terminator.

  • Right click on an empty space of the desktop.
  • Click "Create new".
  • Click "Link to application".
  • Click the tab "Application".
  • Click inside the blank field to the right of "Command:".
  • Write:

    terminator --layout=mylayout
    
  • Click "OK".


Now click on the new icon. You should see all your tabs.

You can create multiple layouts in the same way, and you can modify the directories and other settings by right-clicking on the black screen and clicking "Preferences".

Related Question