1. IMPORTANT - 11/13/2015: In light of a possible breach we have scrubbed all passwords. You will need to request a password reset through the site. Click here for more information.

Linux command: clear

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

  1. LinuxDotOrg

    LinuxDotOrg Administrator

    Jul 9, 2013
    Likes Received:
    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