It bugged me that Cygwin didn’t include the ‘clear’ command. This post explains that installing the ‘ncurses’ package will add clear; and also that C:l will clear the screen in bash. Thanks Hafiz!
It bugged me that Cygwin didn’t include the ‘clear’ command. This post explains that installing the ‘ncurses’ package will add clear; and also that C:l will clear the screen in bash. Thanks Hafiz!
You can actually clear the screen with the following command: “cmd /c cls”. It’s kind of crude and a lot to type just to clear the screen, but it does work. It invokes the Windows command console to do its magic.
ctrl + l does the samething
ctrl + l does the samething if you are using bash
Sandy:
Thank you, I only had the abbreviation in there.
Do the following…
cd /bin
touch clear.exe
notpad clear.exe
…In notepad copy…
cmd /c cls
…save clear.exe and exit notepad…
…at the command line type…
chmod 777 clear.exe
…problem solved. You should be able to type “clear” anywhere in cygwin now and clear the screen.
PS- “notpad” clear.exe should be “notepad” clear.exe. Sorry. itwarz
Itwarz:
Literally sitting here with gmail open on one side and cygwin open on the other. Screen is messed up, and I hit C:l and think to myself “That is still a nifty little feature…”. On the left side of my screen I see an email about a comment on this post.
Synchronicity! 🙂
alias clear=’echo -n ^[[2J’
(where \^[\ is CTRL+V followed by ESQ key). So, keys separated by comas:
^[[2J = CTRL+V;ESC;[;2;J
Other ways: http://cygwin.com/ml/cygwin/1997-07/msg00011.html
It’s not polite use windows cls.exe in cygwin, is it? xD
Regards.
Thanx a lot ITWARZ, with clear.exe notepad installed, Clear command works…THANX again
All it takes is adding this to the end of .bashrc:
alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls’
Even easier, do it from Cygwin Bash:
alias echo “clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls'” >> ~/.bashrc
oops – The “easy” part got mixed up, correction:
echo “alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls'” >> ~/.bashrc
Following ITWARZ post,
if you don’t want to open notepad..
cd /bin
touch clear.exe
echo cmd /c cls > clear.exe
chmod 777 clear.exe
cheers~
Install ncurses… It includes the clear command
Chris:
Thanks.
Sandy, Ctrl+L worked for me.
@ITWARZ : You rock. You are amazing. All praise to you!
Albert: The alias works wonderfully well, though I had to substitute double quotes for the single quotes.
If you right click on the terminal one of the menu options is reset…the keyboard shortcut is Alt+F8.
what should I do to use groupadd and useradd commands in cygwin ?
Ctrl + L worked in my case. Thanks!
CTRL + L worked for me as well.
Tried the clear.exe method, but didn’t worked
crlt+L worked for me too.. Thanks fellas!
If your Cygwin use SHell, then pressing alt+f8 will do the cleaning for REAL, ctrl+l just scroll down to empty the display, i asume,,,
During installation of Cygwin, Expand Utils and get down to the “ncurses” files. There, you will click on the skip item, to the left of the ncurses utils. And than start installation along with other packages you want to install. After finishing installation use “clear” command,you will find, now its working.
Cheers
BRAJESH MURARI:
Thank you!
CTRL+L, WORKED FOR. THANKS
Thanks for sharing your info. I truly appreciate your efforts and I will be waiting for your further write ups thank you once again.