Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I reach the bottom line,


I want to be able to “scroll” down the virtual space so the prompt is at the top again (like in the beginning):


Is there any way to do this?
This becomes even more painful in full-screen mode as it's hard to always type on the bottom line (and I don't want to clear the screen with +K because I need the scrollback).

share|improve this question
Clear doesn't remove the history for me, and I have scroll bars at the side of the terminal which allow me to scroll it down/up – blueberryfields Sep 17 '11 at 17:34
I wasn't clear enough. Clear (Command+K) removes the entries so I can't scroll up anymore. This doesn't suite me. Now, as for the scrollbars, I can't scroll down when I'm at the last command. If it helps, I want the prompt to be in the middle of the page, not at the bottom. – Dan Sep 17 '11 at 17:41
@blueberryfields was referring to the literal clear command, not Terminal's View > Clear Scrollback (Command-K). Entering clear at the command prompt issues a control code that clears the current screen by scrolling it up into the "scrollback log" text. Dan Abramov was referring to Terminal's Clear Scrollback command, which discards the scrollback text in addition to clearing the screen. Dan, it could help clarify your question if you revised it to replace "I don't want to clear because" with "I don't want to use the Clear Scrollback command because". – Chris Page Sep 17 '11 at 23:56
Dan, it could also help clarify if you replaced "because I need the history" with "because I need the scrollback". In the context of terminals, there are two very different things that people sometimes refer to as "history". One is the "command history" kept by the shell program, which you can typically view with the history command or by typing the Up/Down Arrow keys. The other is the "scrollback log" or "scrollback", which records everything that scrolls off the terminal screen and is managed by the terminal emulator program, which is why you use the menu bar or Command key to clear it. – Chris Page Sep 18 '11 at 0:18
@Chris: Thanks for your input. I edited the question. Please feel free to edit it further if you think I missed something. Thanks. – Dan Sep 18 '11 at 0:26
up vote 7 down vote accepted

Press Ctrl+l.
This will scroll the prompt to the first line without affecting the history.

share|improve this answer
Thanks a huge. – Dan Sep 17 '11 at 17:51
Typing in "clear" should also reset your prompt to the first line, without affecting history. – blueberryfields Sep 17 '11 at 19:43
To expand on this answer: Control-L is a keyboard command that the shell understands and it clears the screen exactly the way the clear command does, by issuing a terminal command code that clears the current screen by moving it into the "scrollback log". – Chris Page Sep 18 '11 at 0:00
akira & @Chris Page - Very useful! +1 – JRobert Sep 18 '11 at 0:37
Awesome! Thanks so much for that tip. – daviesgeek Sep 21 '11 at 21:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .