👁36views
Macbook Tip: iTerm2 clearing your scroll back history

CloudScale AI SEO - Article Summary
  • 1.
    What it is
    This article explains how to clear iTerm2's scroll back history using Command + K, distinguishing it from Control + L which only clears the visible screen.
  • 2.
    Why it matters
    Knowing this shortcut helps you truly clear your terminal history instead of just hiding it temporarily, which is useful for privacy or decluttering your workspace.
  • 3.
    Key takeaway
    Use Command + K in iTerm2 to permanently clear scroll back history, not Control + L which only clears the current screen.

I frequently forget this command shortcut, so this post is simply because I am lazy. To clear your history in iTerm press Command + K. Control + L only clears the screen, so as soon as you run the next command you will see the scroll back again.

If you want to view your command history (for terminal) type:

$ ls -a ~ | grep hist
.zsh_history
$ cat .zsh_history