.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "HISTCLEAN" "1" "2026-06-27" "" "General Commands Manual" .P .SH NAME .P histclean - clean shell history file .P .SH SYNOPSIS .P \fBhistclean\fR [options] .P .SH DESCRIPTION .P Clean duplicate shell commands from history files in-place, while preserving the most recent unique occurrence of each command.\& .P .SH OPTIONS .P \fB-h\fR, \fB--help\fR .RS 4 Show help message and exit.\& .P .RE \fB-v\fR, \fB--version\fR .RS 4 Show version and exit.\& .P .RE \fB-d\fR, \fB--dry-run\fR .RS 4 Print the resulted output to stdout without modifying anything.\& .P .RE \fB-b\fR, \fB--backup\fR .RS 4 Create a .\&backup copy of the history file before modifying it.\& .P .RE \fB-i\fR, \fB--input\fR .RS 4 Read history from instead of the default shell history file.\& \fBhistclean\fR will try first to lookup history file using $HISTFILE, then using $HOME/.\&bash_history.\& If no \fBhistory\fR file was found, a \fBCannotAnticipateHistoryFile\fR error will raise.\& .P .RE \fB-o\fR, \fB--output\fR .RS 4 Write resulted output to the specified instead of overwriting the input file.\& Running the command multiple times to the same \fBoutput\fR will overwrite it.\& .P .RE \fB-c\fR, \fB--completion\fR .RS 4 Generate the autocompletion script by provieding the specified shell.\& \fB\fR can be \fBbash\fR, \fBzsh\fR.\& .P .RE .SH ENVIRONMENT .P \fBHISTFILE\fR .RS 4 Path to the shell history file.\& If not set, defaults to \fB$HOME\fR/.\&bash_history.\& .P .RE \fBHOME\fR .RS 4 Used to construct the default history path when \fBHISTFILE\fR is not set.\& .P .RE .SH LIMITATIONS .RS 4 Currently, \fBhistclean\fR only have implementation of \fB.\&bash_history\fR file with their timestamps.\& .br \fBhistclean\fR will work correctly with \fBEXTENDED_HISTORY\fR turned off.\& Meaning it does not have an implementation for parsing \fB.\&zsh_history\fR file with their timestamps.\&