Clearing the Terminal Screen in Cygwin

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!

27 thoughts on “Clearing the Terminal Screen in Cygwin”

  1. 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.

  2. 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.

  3. 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! 🙂

  4. Thanx a lot ITWARZ, with clear.exe notepad installed, Clear command works…THANX again

  5. 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

  6. oops – The “easy” part got mixed up, correction:
    echo “alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls'” >> ~/.bashrc

  7. 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~

  8. Albert: The alias works wonderfully well, though I had to substitute double quotes for the single quotes.

  9. CTRL + L worked for me as well.
    Tried the clear.exe method, but didn’t worked

  10. 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,,,

  11. 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

  12. Thanks for sharing your info. I truly appreciate your efforts and I will be waiting for your further write ups thank you once again.

Leave a Reply

Your email address will not be published. Required fields are marked *