gworley
Posts: 11
Joined: Tue Oct 06, 2020 4:21 am
Location: Kentucky

In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 3:15 am

I cannot find this anywhere.

In DOS you can use the ESC key to clear the command line. It doesn't seem to work on the Raspberry Pi OS. Is there a single key stroke to do the same thing on the Raspberry Pi

Thank you,

George

User avatar
kerry_s
Posts: 1734
Joined: Thu Jan 30, 2020 7:14 pm

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 3:20 am

i think it's ctrl+l
i have an alias for clear so i'm more use to just typing clr.

trejan
Posts: 3062
Joined: Tue Jul 02, 2019 2:28 pm

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 3:22 am

Ctrl+U will clear the line.

The escape key is already used by bash for various things so it isn't a good idea to rebind it. Run "bind -p" to see all the key bindings. \e is the escape key.
kerry_s wrote:
Tue Oct 13, 2020 3:20 am
i think it's ctrl+l
That clears the screen.

klricks
Posts: 7422
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 3:25 am

Not a single keystroke but does what you want. (LXterminal).
[Ctrl] /
also
[Ctrl] c
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

User avatar
kerry_s
Posts: 1734
Joined: Thu Jan 30, 2020 7:14 pm

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 3:34 am

:lol:
ctrl+a & ctrl+e are my most used. mv front & end
ctrl+w for deleting words, some times

most of the time i just can't remember & use the arrow, del or backspace. my minds not what it use to be. :lol:

NimbUx
Posts: 277
Joined: Fri Jan 03, 2020 10:33 am

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 1:21 pm

[Ctrl+U] clears from the beginning of line to current cursor position : so
if cursor is already at end of line, [Ctrl+U] suffices. Else, or if you are unsure :

[End] followed by [Ctrl+U]
... will erase and make sure you a get a clear line at the terminal.

User avatar
jahboater
Posts: 6493
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 1:30 pm

This is all GNU readline stuff (the library used for reading text lines from the keyboard)
It is very powerful and can do vi or emac's style editing. There is a file ~/.inputrc (or /etc/inputrc) that can configure it.
see:

man readline

for all the details. Near the end of the man page is a full list of the emac's mode keybindings and the vi mode key bindings.
Pi4 8GB and Pi4 4GB running Raspberry Pi OS 64-bit

swampdog
Posts: 461
Joined: Fri Dec 04, 2015 11:22 am

Re: In DOS you can use the ESC to clear the command line.

Tue Oct 13, 2020 1:52 pm

"man readline" for everything. Note that you're in "emacs" mode by default.

Clear current line: CTRL-EU (ie: CTRL-E takes the cursor to eol and CTRL-U clears from eol to bol).
Clear screen: CTRL-L.
Cursor to bol: CTRL-A.

"CTRL-A #" is handy if you want to ignore the text. It moves cursor to bol then typing # is the same as a dos "rem" statement. You can just hit CR. Easier done than explained ;-)

Return to “Beginners”