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.