Intro

To search file and open it quickly in bash.

Ops

Installation

git_url=https://github.com/ding3my/bash-search.git
cmd="git clone $git_url;"
eval $cmd

# Append the printf result to your shell profile(e.g. ~/bash_profile). 
git_name="$(basename $git_url .git)"
printf "export PATH=\"\$PATH:$(pwd)/$git_name/\"\n"

Use

ff

To find files whose filename matches your key words.

ff $key1 $key2 $keyn
ff $key1 $key2 $keyn -dir $dir # The default dir is "$(pwd)"

gg

To find files whose content matches your key words and whose mime type is text.

gg $key1 $key2 $keyn
gg $key1 $key2 $keyn -dir $dir # The default dir is "$(pwd)"

F

To open file with the sequence number.

F $num

Dev