Where apps hide your files
iTerm2 splits its data across a preferences file, an Application Support folder and an optional custom folder, so the answer depends on what you want to keep. This page covers each one and the supported way to export.
Checked on a Mac running iTerm2 3.7.6:
~/Library/Preferences/com.googlecode.iterm2.plist
~/Library/Application Support/iTerm2/
~/Library/Application Support/iTerm2/DynamicProfiles/
~/Library/Application Support/iTerm2/Scripts/
~/Library/Application Support/iTerm2/SavedState/
~/.config/iterm2/
The plist holds your settings, including your profiles. The Application Support folder holds Dynamic Profiles, scripts, saved window state and other working data. iTerm2's documentation describes ~/Library/Application Support/iTerm2 as the home of toolbelt notes, dynamic profiles and more.
Recent versions also create ~/.config/iterm2. On the Mac checked it held sockets and AppSupport, and AppSupport is only a symbolic link back to ~/Library/Application Support/iTerm2 (a path without spaces, handy in scripts), not a second copy. Older versions may not have this folder; the plist stays the main settings file either way.
The Library folder is hidden. In Finder, press ⇧⌘G and paste a path above. In Terminal:
open ~/Library/Application\ Support/iTerm2
The plist is a binary property list, so do not edit it in a text editor. Changing settings inside iTerm2 is the safe route. iTerm2 also caches preferences in memory through macOS, so editing the file while the app runs usually has no lasting effect.
There are three supported routes.
Guid, because a Dynamic Profile with the same Guid as a regular profile is ignored.~/.iterm2 (shell integration scripts), ~/Library/Application Support/iTerm2 and your Python API scripts.Check which route you used before wiping a Mac. A profile JSON holds one profile only, not your global key bindings or other app-wide options.
Drop a property list into ~/Library/Application Support/iTerm2/DynamicProfiles and iTerm2 loads the profiles in it. The files may be JSON, XML or binary, and no particular extension is required. Each profile needs a Name and a unique Guid (uuidgen makes one). If any file in the folder is malformed, iTerm2 applies none of the changes, so fix the syntax first when nothing appears.
Run this to see whether a custom folder is set. It reads one key and prints a path or an error, nothing private:
defaults read com.googlecode.iterm2 PrefsCustomFolder
If it reports that the key does not exist, your settings live only in the plist. If you see a path, that folder is the copy to back up.
Leave SavedState and the daemon socket files alone while iTerm2 is open. Quitting iTerm2 and relaunching it recreates what it needs. The Application Support folder on the Mac checked was only 256 KB, so space is not a concern. Your shell history lives in the shell's own files (such as ~/.zsh_history), not in these folders.
The simplest route is Export All Settings and Data on the old Mac and Import All Settings and Data on the new one. Otherwise, install iTerm2, quit it, then either point it at your custom settings folder or copy the plist to ~/Library/Preferences/ and the DynamicProfiles folder across. Relaunch and check profiles and key bindings. If the plist copy does not seem to take, log out and back in so macOS drops its cached copy.
SavedState holds what iTerm2 needs to bring back your windows and tabs after a restart. It is working data, not a place for anything you want to keep. If windows reopen oddly after a crash, quit iTerm2 and move that folder to the Desktop rather than deleting it; iTerm2 recreates it on the next launch, and you can move it back if the change did not help.
To test whether a setting is causing trouble, quit iTerm2 and move com.googlecode.iterm2.plist to the Desktop, then log out and back in before relaunching, because macOS keeps a cached copy of preferences. The next launch starts with default settings. Keep the moved file until you are sure you do not need it.
Spotlight ignores ~/Library and hidden folders like ~/.config, so none of this appears in a normal search for "iterm".
After a few exports you may have profile JSON files in Downloads, a settings folder in iCloud Drive and the live plist, all with similar names. Typing iterm2 into Everywhere lists the plist and the Application Support folder, plus, once it has Full Disk Access (macOS guards Downloads and iCloud Drive), any export whose name contains it; ⌘↵ reveals any of them in Finder. Saved profiles are named after the profile, so search for that name too. It will not search inside a profile for a font or colour name, only file names.
In ~/Library/Preferences/com.googlecode.iterm2.plist, with Dynamic Profiles, scripts and saved state in ~/Library/Application Support/iTerm2.
Settings > Profiles, select the profile, open Other Actions and choose Save Profile as JSON. For everything at once, use Export All Settings and Data in Settings > General > Settings.
In ~/Library/Application Support/iTerm2/DynamicProfiles. Files can be JSON, XML or binary property lists, and each profile needs a unique Guid.
Turn on Load settings from a custom folder or URL in Settings > General > Settings and point it at a synced folder. Changes are then written there, and iTerm2 may ask about saving them when you quit.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised