|
|
|
##Command Structure
|
|
|
|
Bashhub can be accessed from the command line in a couple ways:
|
|
|
|
|
|
|
|
- `bh` for searching
|
|
|
|
- `bashhub` for everything else
|
|
|
|
|
|
|
|
It also provides a key binding of `ctrl + b` for quickly dropping into interactive search.
|
|
|
|
|
|
|
|
##Searching
|
|
|
|
You can search through your commands in a lot of different ways. Check `bh --help` for more specifics.
|
|
|
|
|
|
|
|
Here's some examples:
|
|
|
|
|
|
|
|
###Directory based searching
|
|
|
|
|
|
|
|
All the files you vim'd in this current directory.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ bh -d "vim"
|
|
|
|
```
|
|
|
|
|
|
|
|
###System based searching
|
|
|
|
|
|
|
|
The last 10 curl commands you produced on this system
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ bh -sys -n 10 "curl"
|
|
|
|
```
|
|
|
|
|
|
|
|
##Interactive Search
|
|
|
|
One of the most useful features is interactive search which is accessed via `bh -i` or `ctrl+b`. This is similar to reverse search i.e. `ctrl + r`. Interactive search drops you into a small menu where you can select a command to run on the command line.
|
|
|
|
|
|
|
|
Enter interactive search for all the rsync commands executed in this directory
|
|
|
|
```bash
|
|
|
|
$ bh -i -d
|
|
|
|
(bashhub-i-search): rsync
|
|
|
|
```
|
|
|
|
|
|
|
|
###How search results are ordered
|
|
|
|
By default results are sorted by **most recently** used, and are **unique**. This means frequent commands like `git status` or `ls` will only appear once in the position they were most recently invoked.
|
|
|
|
|
|
|
|
This can be altered by using the `-dups` command to include duplicates
|
|
|
|
|
|
|
|
Your git commands including duplicates.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ bh -dups "git"
|
|
|
|
``` |
|
|
|
\ No newline at end of file |