Linux command: clear

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

  1. LinuxDotOrg

    LinuxDotOrg Administrator

    Messages:
    34
    Likes Received:
    70
    Trophy Points:
    8
    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.


    Usage
    Code:
    clear
    or this handy shortcut.
    Code:
    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