mirror of
https://github.com/quitesimpleorg/hs9001.git
synced 2024-11-21 21:17:51 +01:00
Improve README.md
This commit is contained in:
parent
bb2450b8ec
commit
1a6c75cea9
53
README.md
53
README.md
@ -2,15 +2,33 @@
|
||||
hs9001 (history search 9001) is an easy, quite simple bash history enhancement. It simply writes all
|
||||
your bash commands into an sqlite database. You can then search this database.
|
||||
|
||||
It improves over bash's built-in history mechanism as it'll aggregate the shell history of all open shells,
|
||||
timestamp them and also record additional information such as the directory a command was executed in.
|
||||
|
||||
## Usage / Examples
|
||||
### Search
|
||||
|
||||
```
|
||||
hs [search terms]
|
||||
```
|
||||
You can further filter with options like `-cwd`, `-after` and so on...
|
||||
For a full list, see `-help`.
|
||||
|
||||
```
|
||||
hs -cwd .
|
||||
```
|
||||
Lists all commands ever entered in this directory
|
||||
|
||||
```
|
||||
hs -after yesterday -cwd . git
|
||||
```
|
||||
Lists all git commands in the current directory which have been entered today.
|
||||
|
||||
Also, it (by default) replaces bash's built-in CTRL-R mechanism, so hs9001's database will be used instead
|
||||
of bash's limited history files.
|
||||
|
||||
## Install
|
||||
|
||||
### From source
|
||||
```
|
||||
go build
|
||||
#move hs9001 to a PATH location
|
||||
```
|
||||
|
||||
### Debian / Ubuntu
|
||||
Latest release can be installed using apt
|
||||
```
|
||||
@ -28,31 +46,26 @@ apk update
|
||||
apk add hs9001
|
||||
```
|
||||
|
||||
### From source
|
||||
```
|
||||
go build
|
||||
#move hs9001 to a PATH location
|
||||
```
|
||||
|
||||
### Setup / Config
|
||||
## Setup / Config
|
||||
|
||||
Add this to .bashrc
|
||||
|
||||
```
|
||||
eval "$(hs9001 bash-enable)"
|
||||
```
|
||||
|
||||
This will also create a `hs`alias so you have to type less in everyday usage.
|
||||
|
||||
By default, every system user gets his own database. You can override this by setting the environment variable
|
||||
for all users that should write to your unified database.
|
||||
|
||||
```
|
||||
export HS9001_DB_PATH="/home/db/history.sqlite"
|
||||
```
|
||||
|
||||
## Usage
|
||||
### Search
|
||||
|
||||
```
|
||||
hs9001 search [search terms]
|
||||
```
|
||||
|
||||
It is recommended to create an alias for search to make life easier, e. g.:
|
||||
|
||||
```
|
||||
alias searchh='hs9001 search'
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user