Last Updated : 09 Jun, 2023
clear is a standard Unix computer operating system command that is used to clear the terminal screen. This command first looks for a terminal type in the environment and after that, it figures out the terminfo database for how to clear the screen. And this command will ignore any command-line parameters that may be present. Also, the clear command doesn't take any argument and it is almost similar to cls command on a number of other Operating Systems.
Syntax of the `clear` command in LinuxclearUsing the `clear` command to clear the terminal in Linux.
Terminal Before Executing clear command:
clear-command-in -linuxTerminal after Executing clear command:
clear-command-in-linux Clearing our terminal using `clear -x` in Linux SystemSyntax:
clear -x
Terminal before using `clear -x` in Linux
clear -xTerminal after using `clear -x` in Linux
clear -x Clear Using `CTRL + L` Shortcut in Linux System.We can clear our terminal by using short cut `CTRL+L`.
For GNOME terminal in ubuntu 18.04 press `shift + ctrl + alt + c`.
Using `reset` command to clear our terminal in Linux System.We can clear our terminal using the command `reset` in Linux.
Syntax:
resetUsing `\ec` command to clear our terminal in Linux System.
We can clear our terminal by using command `\ec"`
Syntax:
printf "\ec"
Where `\e` represent the ESC character and `c` is an escape sequence that is recognized by some terminal emulators to clear the screen.
This command is used in some specific terminals only.
What is the difference between `clear` and `reset` command.The `clear` command clears the terminal screen only while when talk about `reset` command, it not only clear the screen but also resets the terminal's settings to their default values.
ConclusionIn this article we have discussed the `clear` command and different ways to clear our terminal screen in Linux. One can easily understand these commands and with no effects can clear their terminal screen anytime.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4