Skip to content

clear

How to Actually Clear a Linux Terminal Screen for Real (No More Scrollback Issues)

Introduction

If you've spent any time working in a Linux terminal, you've likely used the clear command to tidy up your screen. On modern Linux systems (since 2013), clear actually does erase the scrollback buffer by default—thanks to the E3 capability added to ncurses. However, some older systems or configurations may still exhibit the classic behavior where "cleared" content remains visible when scrolling up. Additionally, if you're using clear -x (which preserves scrollback), or if your terminal emulator doesn't support the E3 extension, you may still encounter lingering output.

In this guide, we'll explore how clear works on modern systems, when it might fall short, and provide multiple solutions to fully clear your terminal (including scrollback). We'll also show you how to automate the process for convenience. By the end, you'll be able to wipe your terminal clean—no scrollback ghosts included.

How to Clear GPG Cache/Password After Encryption in Linux Terminal: Secure Your Files

Introduction

GNU Privacy Guard (GPG) is a powerful tool for encrypting and signing files in Linux, ensuring data confidentiality and integrity. When you encrypt or decrypt files with GPG, it often caches your passphrase to avoid repeated prompts, enhancing usability. However, this convenience comes with a security trade-off: if an unauthorized user gains access to your terminal or system while the cache is active, they could decrypt your sensitive files without your passphrase.

Clearing the GPG cache (or passphrase cache) is critical to securing your encrypted data, especially on shared systems, public workspaces, or after completing sensitive tasks. In this guide, we’ll demystify GPG caching, walk through manual and automatic cache-clearing methods, and share best practices to keep your files secure.

How to Clear Mitmproxy Console Logs on Linux: Fixing Shift+C Behavior

Introduction

Mitmproxy is a powerful, interactive HTTP/HTTPS proxy tool widely used for debugging, testing, and monitoring network traffic. Its console-based interface provides real-time visibility into requests, responses, and logs, making it indispensable for developers and security analysts. However, one common frustration among Linux users is figuring out how to clear console logs and flow lists efficiently—Mitmproxy uses its own keybinding system that differs from standard terminal shortcuts.

This blog explains how log and flow clearing works in Mitmproxy, explores the built-in commands and default keybindings, and provides step-by-step solutions to customize keybindings so you can clear logs with a shortcut that feels natural. Whether you’re a seasoned Mitmproxy user or just getting started, this guide will help you keep your console clean and focused.