GeistHaus
log in · sign up

Ctrl+L vs clear

anagogistis.com

In a terminal, you can clear the screen in two common ways: Run the clear command Press Ctrl+L The result looks the same at first, but there’s a catch: clear can also wipe your scrollback buffer1, while Ctrl+L never does. Also, behind the scenes they’re implemented in different ways. Ctrl+L When you press Ctrl+L at the Bash prompt, it’s not invoking an external program, but instead it’s handled inside GNU Readline, the library Bash uses for interactive line editing2. In Readline’s input keymap, the key Ctrl+L is bound to the clear-screen function. You can confirm this with:

0 pages link to this URL

No pages have linked to this URL yet.