Hacker News new | ask | show | jobs
by apas 3939 days ago
How is cmd + K different from cmd + R and/or $ clear?
2 comments

Using ⌘+K will not only clear the screen, but will also delete the scrollable history buffer in Terminal or iTerm2.

I find this useful before printing text that I want to search using ⌘+F.

$ clear is six characters, and you have to be on a new prompt first. ⌘R is a reset command, meaning it's for restoring a garbled terminal. ⌘K will keep your input on the line but clear other output, same as ⌃L but more pinky-friendly.