How to completely empty the terminal screen in the CentOS system

Source: Internet
Author: User
Tags printf reset centos

how to completely empty the terminal screen in the CentOS system

There are many other ways to clean the screen on the Internet, but they are basically variants of the clear command. So how can you really empty the screen?

Coincidentally, I recently discovered an order that can completely solve our problems.

printf "33c" is the command we need. It really clears the terminal screen, and its functionality is similar to the CLS effect provided by CMD.EXE in DOS.

But what does this command do? How does it work?

x1b = = = = = ESC

The command then becomes C, which is the escape code in Vt-xxx that represents "full Reset (RIS)." All the terminals we use today are VT-compliant, but if you find yourself using a very strange terminal, you may not be able to use this command. printf is the built-in command in bash, and the built-in commands have higher precedence than other executables.

We can also use another command, reset, which also clears the terminal screen, but we can still use the up and down keys to view the history commands. One disadvantage of this command is that it performs a bit slowly, perhaps because it does not send ESC C instructions, but the compatibility of this command is obviously better than that of the previous one.

The reset command is useful in your terminal control disorder. Have you ever encountered a situation where the input character does not appear in the position of the cursor? When you hit the ENTER key, the new prompt does not show up on the new line, but appears in front of the old prompt. The reset command is to fix the problem. You can also use this command on the Cygwin.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.