Like the alias "clear" CTRL + L keystroke

I have the habit of issuing a clear command.

When I run cygwin, the package containing clear is not installed, and I have no way to install it. Ctrl + L is a good replacement; however, I still issue the clear command normally.

I would like to assign the clear keyword to trigger the Ctrl + L key press . Can this be done in a .bashrc or something like this?

Thanks!

+4
source share
1 answer

clear clears the screen simply by displaying some ANSI escape sequences. You can do the same with printf :

 alias clear='printf "\e[H\e[2J"' 
+10
source

Source: https://habr.com/ru/post/1495589/


All Articles