Is it possible to see a log or history of previous iTerm2 sessions?

Mascros picture Mascros · Jan 30, 2016 · Viewed 21.6k times · Source

Is there a log of recent terminal sessions at all? Or anyway I can see what was written to console before I last quit?

Answer

TabeaKischka picture TabeaKischka · Mar 4, 2016

There is the option to save a log of your session to a file, however, by default this isn't done.

To activate the session logs, go to iTerm2 Preferences (⌘,), select the "Profiles" tab, then the "Session" tab. Under "Miscellaneous" you can specify a folder where log files for your sessions shall be saved in the future.

screenshot with the preferences you need to adapt

Edit:

These session logs can become quite big, so you might want to have a look from time to time to not clutter your drive.