Clear command in Unix|Linux|windows with examples

In Unix, Operation System, You will run multiple commands in terminal, and you want to clear the previous run commands on the terminal.

clear commands works in following operating systems

  • Linux flavours
  • Unix
  • Mac
  • Ubuntu
  • Bash shell
Grep examples in linux

Clear command clear the content on terminal in Linux and Unix.

This command not accepts any arguments

Here is an syntax

$ clear

This clears the current screen commands and output and show a new prompt

Shortcut command to clear the command line in terminal windows.

There are multiple short cuts to clear command lines

ctrl + U - clear the terminal screen and displays a new terminal

How to cancel the current command?

ctrl + C command cancels the current command without running and displays same prompt screen.

In Bash Shell, You can use Ctrl+L command used to clear the screen.

How to clear command line in windows

cls command in windows used to clear the current screen terminal.

Here is an syntax and example


It has no command line options

Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
You'll get a notification every time a post gets published here.