Re:OS X Command Line Utilities
by apas on Sunday August 30, 2015 @12:59PM
(#10143816)
How is cmd + K different from cmd + R and/or $ clear?
[ Parent
| on HN ]
Re:OS X Command Line Utilities
by osxosxosxosxosx on Sunday August 30, 2015 @01:22PM
(#10143900)
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.