https://github.com/fedeztk/glocate
glocate is a Go alternative to locate and updatedb in one command. It creates a small DB thanks to lz4 compression
https://github.com/fedeztk/glocate
cli filesystem go golang linux locate lz4 terminal updatedb
Last synced: 2 months ago
JSON representation
glocate is a Go alternative to locate and updatedb in one command. It creates a small DB thanks to lz4 compression
- Host: GitHub
- URL: https://github.com/fedeztk/glocate
- Owner: fedeztk
- License: mit
- Created: 2023-08-23T15:53:32.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-25T16:26:08.000Z (almost 3 years ago)
- Last Synced: 2025-01-09T04:48:42.021Z (over 1 year ago)
- Topics: cli, filesystem, go, golang, linux, locate, lz4, terminal, updatedb
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Glocate
[](https://goreportcard.com/report/github.com/fedeztk/glocate)

**A simple cli tool for indexing/searching files in your filesystem**

`glocate` is an alternative to the `locate`/`updatedb` commands written in Go.
## Installation
```bash
go install github.com/fedeztk/glocate@latest
```
## Usage
Create the index database
```bash
glocate --index
```
Search for a pattern (regex are supported out of the box)
```bash
glocate "pattern" # case sensitive
```
```bash
glocate --smartcase "pattern" # case insensitive if the pattern is all lowercase
```
```bash
glocate --color "pattern" # colorize the output
```
For a full list of options and shortcuts see the help page
```bash
glocate --help
```
### Configuration
The configuration can be done via environment variables, flags, and a config file.
The config file is in yaml format. It will be created automatically if it does not exist under `$HOME/.config/glocate/glocate.yaml`. Default values are shown below.
```yaml
directories: # directories to index
- "$HOME"
ignoredPatterns: # patterns to ignore
- "$HOME/.cache"
ignoreSymlinks: true # do not follow symlinks
ignoreHidden: false # ignore hidden files
```
### Acknowledgements
A special thanks to the creator of the walk implementation used to walk the filesystem ([see here](https://github.com/opencoff/go-walk)).
Acknowledgements also go to the creators of all the other libraries used in this project, see [go.mod](go.mod) for a full list.