Open In App

How to Clear The Screen on Putty

PuTTY is a free and open-source terminal emulator. It is used to connect to remote hosts and devices using various network protocols (SSH and Telnet are the most common ones).

PuTTY is mainly used by system administrators and IT professionals for quick remote access to servers. Its lightweight design, ease of use, and support for various network protocols make it a popular choice among professionals.



The major use cases of PuTTY include:

To put it in simple words, PuTTY is an SSH and telnet client.



PuTTY can be downloaded from https://www.putty.org

Understanding the Interface

PuTTY Screenshot

As seen in the above screenshot, PuTTY has four main categories:

1. Session

Configure and define the host you want to connect to and how you want to connect.

2. Terminal

Provides options to customize the terminal’s feel by allowing you to modify the keyboard behavior, change the sound of the alert, and more.

3. Window

Provides options to control the appearance of the terminal. Allows you to change the font, size, color, and other display-related settings of the terminal.

4. Connection

Provides options to customize how you connect to a remote host. Adjust settings for secure connections (SSH), set up simpler connections (Telnet), manage proxies for added security, and many more.

Topic Explanation

PuTTY, as mentioned before, is a popular terminal emulator among professionals, so maintaining a clean and organized workspace is essential.

Let us first connect to a remote host using PuTTY.

Step 1:

Note: In the above example, I am connecting to a virtual Ubuntu machine via Port 2222 from Windows.

Step 2:

Enter your password

Note: Password won’t be visible while typing.

Once you enter the correct password, PuTTY will give you access to the host’s terminal.

Terminal on successful login

Let us explore the methods to clear the screen in PuTTY.

Note: I am executing the “ps -aux” command in the below examples.

Method-1: Using ‘clear’ command

PuTTY supports Unix-like commands. Using the command “clear” will clear the screen and provide you with a clean slate.

clear command

Note: If you have connected to a Windows host, the the ‘clear’ command might not work as expected, instead use ‘cls’ command to clear the screen.

Method-2: Using ‘CTRL+L’

PuTTY supports a keyboard shortcut: CTRL+L, to clear the screen.

CTRL+L Method

Method-3: Using ANSI Escape Sequence

An ANSI escape sequence is a series of characters that, when embedded in a text stream, are interpreted by terminal emulators to perform various functions, introduced by the American National Standards Institute (ANSI).

‘\033c’ is used for erasing text.

printf "\033c"

Executing the above command will clear the entire screen in the PuTTY terminal.

Ansi Escape Sequence

Conclusion

PuTTY is a widely used tool to establish a connection to a remote host and emulate the terminal functionalities. It is often essential to clear the screen for better visibility and organizing the workspace. Users can choose any of the above methods to clear the entire screen instantly, whether it is by using clear using the keyboard shortcut CTRL+L or using the ANSI escape sequence, all do the job.

Article Tags :