Advertisement

Getting bash to clear the command line.

Started by October 29, 2005 01:46 PM
9 comments, last by NicoDeLuciferi 19 years, 2 months ago
Is there a way to clear the command line using the escape key... I would like to get bash just to basically start over when I press ESC. Thanks, L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
hit ctrl + c,
Advertisement
Dude, I am so newbie at linux -- hahaha.

L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Typical keyboard combinations are ctrl-U (i.e. erase line), which works in just about any shell, or anywhere, as I suspect it's normally part of the tty handling, and ctrl-K (erase to end of line).

Of course neither of these erases the whole command, but if you use them both, then there will be nothing left.

But gosper is right, ctrl-c works too

Mark
Clear works... it does what it's suppose to.

Thanks markr -- that was some stuff I didn't know -- very handy.

And of course ctrl-c work fine as well.

Thanks a lot,
L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Ctrl-l (<- a small L) for clear
Advertisement
Doesn't CTRL+C send TERM signal to whichever process you press it on?
CTRL+C certainly doesn't clear my Bash shell, it terminates whatever program the shell is running.
The idea is just to clear the command line, not to stop a programm, I suppose the catch should be that there is not a program runnig at the time.

L-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
ctrl-c will send the term signal, but shells don't die on that, many just reset themselves. In order to actually kill off a shell, you have to send the kill signal (signal 9)
control-l is not a clear-screen AFAIK; it's a screen refresh (for ncurses-type apps).

This topic is closed to new replies.

Advertisement