Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Screen cleaning method of linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article to share with you is about linux screen cleaning method, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after some harvest, not much to say, follow Xiaobian to see it.

1, clear command, this command will refresh the screen, essentially just let the terminal display page turn back one page, if you scroll up the screen can also see the previous operation information.

2, Ctrl+l(lowercase L), this is a shortcut key to clear the screen, this is the most used in the work of a clear screen method, clear screen effect with the clear command. (Recommended learning: Linux operation and maintenance)

3, reset command, this command will completely refresh the terminal screen, before the terminal input operation information will be cleared, although relatively refreshing, but the whole command process is a bit slow, less used.

It is worth mentioning that the reset command is useful when your terminal is out of control. Such as input characters do not appear at the cursor position. And when you hit Enter, the new prompt doesn't appear on the new line.

Instead, it appears in front of the old prompt. The reset command can then be used to correct these problems.

4. printf "\033c" command

This command really clears the terminal screen, and its function is very similar to the CLS effect provided by CMD.EXE in DOS. But what exactly does this order do? How does it work?

\033 == \x1B == 27 == ESC

The command then becomes c, which is the escape code for "Full Reset (RIS)" in VT-XXX. All the terminals we use today are VT compatible, and another way to implement it can be like this:

Ctrl+v-->Esc--> C on the keyboard and back again. But if you find yourself using a very strange terminal (as I tested on Putty), you may not be able to use this command.

Printf is a command built into bash, and the priority of built-in commands is higher than other executable files.

Compare the above four screen clearing methods under PATH, such as/usr/bin/directory. Create a file named cls, add execute permissions, and write the following contents:

In this case, every time we need to clear the screen, we only need to enter the cls command.

The above is the linux screen cleaning method, Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report