Skip to main content

parse_bash_history

Function parse_bash_history 

Source
pub fn parse_bash_history(content: &str) -> Vec<String>
Expand description

Parse a bash history file, extracting command lines.

Skips:

  • Lines starting with # (timestamps from HISTTIMEFORMAT)
  • Blank/whitespace-only lines

Each remaining line is trimmed and returned as one command.