Clear scroll back buffer in zsh

In bash you can use ctrl + L to clear the scroll back in the terminal. However in zsh, it doesn't work. So here is a workaround. You can use a control sequence to clear it, and set an alias for that. 


Open your  .zshrc file in the editor.

$ vim ~/.zshrc

And add this to the file.

alias cls='printf "\ec\e[3J"'

Save and reload the terminal: or

    $ source ~/.zshrc


Now when you run the command 'cls', it should clear your terminal with its scroll back buffer. Hope it helps. 


  1. love the content of this blog and the positive intent you have. Thanks!

  2. Hi.

    Thank you for sharing this information. This good blog this blog was gives good information and we learn new thing in this blog thank for sharing this blog with us.

    Here is sharing some VMware information may be its helpful to you.

    VMware Training