{

Clear command in Unix|Linux|windows with examples


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

clear commands work in following operating systems

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

Clear command clears the content on a terminal in Linux and Unix.

This command does not accept any arguments.

Here is a syntax

$ clear

It clears the current screen commands and output and shows a new prompt

Shortcut command to clear the command line in terminal windows.

There are multiple shortcuts 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 the same prompt screen.

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

How to clear command line in windows

CLS command in windows is used to clear the current screen terminal.

Here is a syntax and example

C:\cls

It has no command-line options.

THE BEST NEWSLETTER ANYWHERE
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
Subscribe
You'll get a notification every time a post gets published here.