A python tool connected to your console to store important commands and search them in a new and faster way
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bash
data
fastHistory
images
.gitignore
LICENSE
README.md
fastHistory.conf

README.md

fastHistory

A python tool connected to your terminal to store important commands and search them in a new and faster way

Search sample

Why you need it?

How often do you need to reuse a command but you cannot remember it (or all the needed options/flags)?

# example of an 'intuitive' and 'obvious' bash command from my bash history
$ srm -lrvz f1 f2 d1/

How many times do you search the same command on Google, over and over?

42 times.. yes.. based on my experience the answer is 42

And how many times have you told yourself to store this super useful command but you didn't?

I saved them all ..totally, with a good and detailed explanation for each command

if you know what I am talking about, fastHistory is the tool you are looking for!

The tool

fastHistory can save your commands directly from your terminal, all you need is a #

$ srm -lrvz f1 f2 d1/ #
                     /\
                      \------- fastHistory will store "srm -lrvz f1 f2 d1/" in its internal database

You can specify one or more tags

$ srm -lrvz f1 f2 d1/ #secure #remove #file #directory

or a description

$ srm -lrvz f1 f2 d1/ #@delete file and overwrite it 2 times

or both

$ srm -lrvz f1 f2 d1/ #secure #remove #file #directory @delete file and overwrite it 2 times

Finally, to search your saved commands, all you need is f

$ f secure

fastHistory will then inject the selected command in your terminal input

Search sample

Furthermore, for each saved command you can get a fast summary from the man page with details of the used options/flags Warning: this feature currently does not cover the syntax of all commands

Info ls sample

How to install

Warning: this tool is still under development! A first version will be soon released

  1. download this repository
cd $HOME
git clone https://github.com/mkcn/fastHistory.git
  1. enable fastHistory in your terminal
echo 'source "$HOME/fastHistory/bash/f.sh"' >> .bashrc

done!

Commands and syntax

Simple adding

command_to_save [#[tag [#tag ...]][@description]]

Explicit adding without execution

fadd command_to_save [#[tag [#tag ...]][@description]]

Simple search

f [filter]

OR search: match any row where at least one of the following conditions is true:

  • the filter word is contained in the command
  • the filter word is contained in one or more of the tags
  • the filter word is contained in the description

Advanced search

f [command_filter] [#tag_filter ...] [@description_filter]

AND search: match any rows where all the following conditions are true:

  • the command_filter is contained in the command
  • all the tag_filter are contained in the tag list
  • the description_filter is contained in the description

License

The license for this is the same as that used by GNU bash, GNU GPL v3+.

Copyright

The following external projects have been used as part of fastHistory:

  • https://github.com/rcaloras/bash-preexec
    • goal: this bash script is used to hook the commands from the terminal
    • code section: bash-preexec.sh
    • changes: no change
  • https://github.com/idank/bashlex
    • goal: this Python module is used to parse bash commands in order to show info from the man page
    • code section: fastHistory/parser/bashlex/
    • changes: no change
  • https://github.com/wong2/pick
    • goal: this Python module has been used to select the option from the menu
    • code section: fastHistory/pick
    • changes: all code has been restructured and adapted with a different UI