GithubHelp home page GithubHelp logo

historian's Introduction

historian

Command-line utility for managing shell history in a SQLite database.

~/.bash_history is deduped and imported into a database.

Requirements

  • SQLite
  • a home directory

Installation

Download and 1) add the directory to your $PATH

export PATH="$PATH:/Users/jerry/historian"

or 2) add hist as an alias.

alias hist="/Users/jerry/historian/hist"

Super Installation

Add hist import to your .profile (assuming hist is in your path):

$ echo hist import >> ~/.profile

This will import your .bash_history every time you launch a new shell.

Getting Started

Import your ~/.bash_history

$ hist import

Usage

Show config:

version:      0.0.1
bash_history: /Users/jerry/.bash_history
db:           /Users/jerry/.historian.db
sqlite3:      /opt/local/bin/sqlite3

Search:

$ hist search monsters
690
    echo a zombie with no conscience >> ~/monsters
689
    echo ghoul >> ~/monsters
688
    echo goblin >> ~/monsters
687
    echo lochness >> ~/monsters

Search (shorthand):

$ hist /monsters
690
    echo a zombie with no conscience >> ~/monsters
689
    echo ghoul >> ~/monsters
688
    echo goblin >> ~/monsters
687
    echo lochness >> ~/monsters

View log:

$ hist log
1020
    rm -f README.md
1019
    emacs README.md
1018
    rm -rf .git

Pitfalls

Live like your db file could be corrupted at any time.

Be wary of running specially crafted hist commands or against ~/.bash_history files.

Cool Things in the Future

  • export to append to ~/.bash_history
  • scrub items from history
  • set or autodetect configs
  • other shells than bash
  • timestamp support

historian's People

Contributors

jcsalterego avatar

Watchers

Thys Meintjes avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.