OSX equivalent for reset

On linux machines I used to type reset on terminal.

It was like, closing and reopening the terminal! It is very convenient, because in debugging you wont mix error messages from previous executions.

The command does exists on OSX, however when i scroll up, the previous output is there too!


Solution 1:

As you mentioned, reset does work in OS X, however you can combine it with ⌘ cmd + ⌥ alt/option + K to 'Clear Scrollback'. This clears Terminal's history scrollback.

Alternatively, you can just use ⌘ cmd + K to 'Clear All'. This works similarly to how you use reset in Linux.

Solution 2:

In OSX's Terminal.app, you can hit command + K

This will clear your terminal session completely.

Also see this

Use the right tool for each job:

Use clear to clear the terminal window.

Use reset to reset your terminal when it gets messed up by control sequences.

Use cat only when you want to stream a whole lot of data from one place to another uninterrupted.