This tutorial explains Linux “clear” command, options and its usage with examples.
DESCRIPTION
The `clear` command is one of the most handy commands to know if you are a command line user in Linux. As you are moving through directories, `cat`ing files, or any number of standard tasks, your terminal will get filled up with a bunch of prior commands and output. If you want to start from a blank slate, but don’t want to log out and log back in, then using `clear` will become a handy tool.
The clear command is used to remove all previous commands and output from consoles and terminal windows in Unix-like operating systems.
Clear is one of the very few commands in Unix-like operating systems that accepts neither options nor arguments (i.e., input files).
In Unix-like operating systems there are often multiple ways of performing the same task:
For example, the same result as using the clear command can be achieved in the bash shell by simultaneously pressing the CONTROL and l (lower case L) keys.
The bash shell also allows a single line to be cleared by simultaneously pressing the CONTROL and 7 (number seven) keys.
In addition, everything except the current line can be removed by simultaneously pressing the CONTROL and L (upper case L) keys.
SYNOPSIS
clear
Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.
- Practice Programming MCQs
- Apply for Programming Internship
- Check Information Technology Books
- Check Linux Books