← all articles

How to see terminal history on Mac (and find output that scrolled away)

You can find the command you ran yesterday, and the output that told you what broke is gone.

To see terminal history on a Mac, type history in Terminal. Since macOS 10.15, Apple says a Mac uses zsh as its default shell, and the zsh manual says history is the same as fc -l, which lists your recent commands. Run fc -l 1 to list from the first event in your history list. The output those commands printed lives in the Terminal window's scrollback, not in that list.

When the output scrolled away or got cleared, a screen history app like ReMynd can find it, if your terminal was the window you were working in after you installed it.

Lost the error message your terminal printed an hour ago? Download ReMynd

Do you need the command, or what it printed?

Ask that first, because on a Mac they live in two places. Commands sit in your shell's history list. What they printed sits in the terminal app's scrollback, which you set per profile.

If you're not sure which app the thing was even in, which app did I see it in helps you narrow it down. And if you can't find the Terminal app itself, where is Terminal on Mac covers that.

Diagram with the eyebrow Terminal history, titled Commands and output live apart, subtitled Your shell keeps one, your terminal app keeps the other. Left card zsh history lists history, fc -l 1 and fc -li, labelled The commands you ran. Middle card Scrollback lists Command-F find, Command-S export and Command-K clear to start, labelled What they printed. Right dark card, outlined in claret, reads Scrolled away? Search what was on your screen. Or cleared, or the window closed.

Your zsh history keeps commands, and the scrollback keeps what they printed. Illustration by ReMynd.

The 4 places terminal history lives on a Mac

Terminal history on a Mac lives in these places, and each one keeps something different.

  • The zsh history list. history or fc -l lists it. The zsh manual says HISTSIZE is the maximum number of events stored in the internal history list.
  • The zsh history file. HISTFILE is the file to save the history in when an interactive shell exits. If it's unset, the history is not saved. SAVEHIST sets the maximum number of history events to save in that file.
  • Terminal's scrollback. Apple's Terminal guide says the Window settings let you set a limit to the number of rows in the Terminal window that you can scroll back through. A separate Resume option restores the text from a previous app session.
  • iTerm2 scrollback. If you use iTerm2, its Scrollback lines setting is the number of lines kept above the visible part of the screen.

How to see zsh history with dates and search it

zsh history gets more useful with two flags.

  1. List from the start. fc -l 1 lists from event 1. The zsh manual says that with -l and no range, fc lists the last 16 events.
  2. Add timestamps. fc -li prints full time-date stamps in ISO8601 format. To write timestamps into the history file, turn on EXTENDED_HISTORY, which saves each command's beginning timestamp and duration.
  3. Search for one command. fc -l -m 'kubectl' 1 lists only the history events matching the quoted pattern.

What each kind of terminal history keeps

Each tool keeps a different slice of your terminal output history.

Where you lookWhat it keepsWhat it missesSource
zsh history (history, fc -l)Your history events, and their saved timestamps if EXTENDED_HISTORY is onEvents past HISTSIZE or SAVEHISTzsh builtins, zsh options, zsh parameters
Terminal scrollbackRows you can scroll back through, within the limit you setRows past the limit you setApple Terminal guide
Terminal export (Command-S)The window's text, through Export text asAnything printed after you exportApple Terminal guide
iTerm2 scrollbackLines kept above the visible screenLines from alternate screen mode, which are saved only if that option is enablediTerm2 docs
ReMynd screen historyText that was on your screen in the window you were working in, after installAnything before install, apps and sites you excludeReMynd

A simple decision path

Start with the quickest check and stop when you find it.

  1. Search the open window. Press Command-F in Apple's Terminal and type a word from the output. Command-Home scrolls to the top.
  2. Jump between marks. Command-Up Arrow jumps to the previous mark in Apple's shortcut list.
  3. Find the command. Run fc -l -m 'word' 1 to get the exact command back, then run it again if it's safe to.
  4. Export before you clear. Command-S exports the window's text. Do it before Command-K, which Apple lists as Clear to start.
  5. Search your screen history. If the output scrolled past your limit, got cleared, or the window is closed, and ReMynd was installed when it printed, search what was on your screen for a word from the error.

My own fix, not Apple's: raise the scrollback limit on the profile you use for long builds, and keep iTerm2 off unlimited unless you've got the memory for it.

Where ReMynd fits

ReMynd is a desktop app that gives your computer local photographic memory, for you and your AI agents. It locally captures your screen history and keeps the searchable index on your computer.

So a stack trace, a config value or a build log that was in your terminal, while it was the window you were working in after you installed ReMynd, becomes searchable by the words in it. Text recognition reads the window you're working in, not the windows behind it.

Same idea as finding something you saw on your screen. If the output came from an agent, Claude Code keeps suggesting the fix I already tried and recovering a Claude Code session after a crash cover the agent side.

If the output came from Claude Code, Ctrl+O opens its transcript viewer, which Anthropic's docs say shows detailed tool usage and execution. Developers can also run ReMynd's command from the terminal itself, once Claude Code or Codex is turned on in Settings, Integrations.

Your screen history is stored on your computer by default, and nothing is uploaded to us unless you turn on optional cloud sync. You can pause capture or block any app or site. That's how ReMynd's own pages put it, as of December 2026. On a Mac, ReMynd needs screen recording permission, which Apple's guide puts in System Settings under Privacy & Security, Screen & System Audio Recording.

Honest limits

These limits matter before you rely on any of this.

  • None of the zsh manual pages I read on December 3, 2026 describes the history list or history file keeping a command's output. For output, use scrollback, an export or your screen history.
  • ReMynd captures only what is on your screen, starting from install. It can't recover output from before that.
  • Output in a window you weren't working in, or in a terminal behind another window, isn't read.
  • On a Mac, ReMynd needs Apple silicon and macOS 15 or later. ReMynd also runs on Windows 11 (x64 or arm64).

The short version

Use history or fc -l when you need the commands. For output, search the open window with Command-F, and export with Command-S before you clear. When an incident is the reason you're digging, the incident timeline template helps you write it up.

Want the next error your terminal prints to stay findable after it scrolls away? Download ReMynd

common questions

How do I see my terminal history on a Mac? +
Type history in Terminal. On a Mac with zsh, the default shell since macOS 10.15, history is the same as fc -l, which lists your recent commands. Run fc -l 1 to list from the first event in your history list.
How do I see terminal history with timestamps? +
Run fc -li. The zsh manual says -i prints full time-date stamps in ISO8601 format. For timestamps to be written to your history file, the EXTENDED_HISTORY option saves each command's beginning timestamp and duration.
How do I search zsh history for one command? +
Use fc -l -m with a quoted pattern, for example fc -l -m '*kubectl*' 1. The zsh manual says -m takes the first argument as a pattern and only the history events matching it are considered.
Can I get back terminal output I cleared with Command-K? +
Command-K is Clear to start in Apple's shortcut list, so export the window first next time. If you exported the window text first with Command-S, the export has it. If the terminal was the window you were working in after you installed ReMynd, a search of your screen history can find the words.
How do I keep more terminal output in scrollback? +
In Terminal, choose Terminal > Settings > Profiles, select a profile, click Window and set the Scrollback limit. In iTerm2, the Scrollback lines setting controls it, and iTerm2's docs warn that unlimited scrollback can grow indefinitely, possibly using all available memory.