With the default Terminal.app, one can select the previous command output with Cmd + Shift + A and then copy it with Cmd + C (source).
Is there a similar shortcut for iTerm2?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
I figured out the solution:
Install Shell Integration
Select Output of Last Commandis enabled, and that the shortcut Cmd + Shift + A works as well.