How to clear CYGWIN screen in Windows ?

This is just a small tip. A lot of us use CYGWIN as a port of *nix apps in windows to do various things. And we use different types of terminal like CMD on windows, Git-Bash or Konsole. Now the problem is, CYGWIN default (or even advanced) installation option doesn’t have ‘clear’ command like we have it in Linux. And it’s annoying esp. when we try a ls -l command and it fills up the screen. The undocumented feature of CYGWIN console is that it clears up the screen when you press CTRL+L.

So, use it when u need it :)

Author's gravatar

Md. Mahbubur Rahman

11 thoughts on “How to clear CYGWIN screen in Windows ?

    Author's gravatar

    Hey man!

    You can get the clear command till cygwin thru some package… Didn’t know witch one but a little google and “utils->ncurses supplies the official clear program ” :)

    sorry for bad english

    Author's gravatar

    ctrl+l works, but I type clear out of habit and it gets annoying… and it’s easy to add the clear command:

    Add this to your .bashrc:
    alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls

    Do it the hard way (open the file), or from Cygwin bash:

    echo ”
    alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls'” >> ~./bashrc

    Author's gravatar

    typo in last post (~/.bashrc NOT ~./bashrc):

    echo ”alias clear=’/cygdrive/c/Windows/System32/cmd.exe /c cls’” >> ~/.bashrc

    Author's gravatar

    Thanks Will for your hacks. I’ll add that in the article shortly :)

    Author's gravatar

    About clearing CYGWIN screen in Windows whatever mentioned isn’t simply small tip but also very very exciting working results display here. I really impressed to get this supportive feedback. I’m sure this short story simply award wining. Thanks a lot! :)

    Author's gravatar

    add ‘ncurses’. it has clearw.exe. (clear for wide screen)

    Author's gravatar

    Hi,
    IMHO, clear has nothing to do with screen, but with Cygwin (or *NIX). It is a program.
    Install it and if it runs under Cygwin, without screen, it will run in screen too.
    For me there is no problem with clear in screen.
    Regards.
    Syco

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