Skip to content

A simple script to clean and sanitize your Zsh command history by removing non-readable entries, ensuring a tidy and secure .zsh_history file. The script renames the existing history file, extracts readable commands, and reloads the cleaned history for immediate use.

Notifications You must be signed in to change notification settings

A9u3ybaCyb3r/zsh-history-sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Zsh History Sanitizer

Overview

The Zsh History Sanitizer is a simple shell script designed to clean and sanitize your Zsh command history. By removing non-readable or corrupted entries, it ensures that your .zsh_history file remains tidy and secure, preventing the accidental exposure of sensitive commands.

Features

  • Backup Creation: Renames the current .zsh_history file to .zsh_history_bad for backup purposes.
  • Readability Enhancement: Utilizes the strings command to extract readable entries and create a new .zsh_history file.
  • Instant Reload: Immediately reloads the cleaned history into the current shell session.
  • Cleanup: Removes the backup file after processing to save space.

Usage

  1. Clone the repository:
    git clone https://github.com/A9u3ybaCyb3r/zsh-history-sanitizer.git
    cd zsh-history-sanitizer
    
  2. Make the script executable:
    chmod +x zsh_history_sanitizer.zsh
    
  3. Run the script:
    ./zsh_history_sanitizer.zsh

About

A simple script to clean and sanitize your Zsh command history by removing non-readable entries, ensuring a tidy and secure .zsh_history file. The script renames the existing history file, extracts readable commands, and reloads the cleaned history for immediate use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages