Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

Linux command: clear

Discussion in 'Shell / Command Line' started by LinuxDotOrg, Jul 10, 2013.

  1. LinuxDotOrg

    LinuxDotOrg Guest

    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 does not affect files or jobs, it simply clears the clutter from your terminal screen. Another nice thing about `CLEAR` is that it doesn't erase your terminal scroll buffer, so if you need to see something that was on your screen a while ago, you can still use your mouse wheel to scroll back.

    or this handy shortcut.
    CTRL - l
    (that's a lowercase L)

    Another way that you can use `CLEAR` is when you are in a text editor (like emacs), and want to re-orient your screen so that your cursor is in the middle of the screen. Oftentimes I am writing a bit of code, and end up at the bottom of the screen, and find it hard to look at, so I just hit `ctrl-l`, and my code is now nicely positioned in the middle of the screen.

Share This Page