{"id":13587726,"url":"https://github.com/dedukun/kokatu","last_synced_at":"2026-03-02T00:18:13.971Z","repository":{"id":116402107,"uuid":"288737367","full_name":"dedukun/kokatu","owner":"dedukun","description":"Simple POSIX script that uses fd and ripgrep to work as a faster mlocate","archived":false,"fork":false,"pushed_at":"2021-06-14T10:27:15.000Z","size":195,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-14T21:56:07.484Z","etag":null,"topics":["fd","lz4","mlocate","posix-sh","ripgrep","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dedukun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-19T13:19:54.000Z","updated_at":"2024-08-01T16:33:42.636Z","dependencies_parsed_at":null,"dependency_job_id":"7a87b409-291f-4474-ad1c-17b003215050","html_url":"https://github.com/dedukun/kokatu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedukun%2Fkokatu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedukun%2Fkokatu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedukun%2Fkokatu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dedukun%2Fkokatu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dedukun","download_url":"https://codeload.github.com/dedukun/kokatu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247740831,"owners_count":20988276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fd","lz4","mlocate","posix-sh","ripgrep","shell-script"],"created_at":"2024-08-01T15:06:20.079Z","updated_at":"2026-03-02T00:18:13.845Z","avatar_url":"https://github.com/dedukun.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# kokatu\n\n[kokatu](https://translate.google.com/#view=home\u0026op=translate\u0026sl=en\u0026tl=eu\u0026text=locate)\nis a POSIX script which works as a wrapper for [fd](https://github.com/sharkdp/fd) and [ripgrep](https://github.com/BurntSushi/ripgrep),\nbringing a similar functionality to mlocate, i.e, it indexes the system files and then allows the user to search in this index.\n\n## Requirements\n\nFor the base usage of kokatu, you only need to have [fd](https://github.com/sharkdp/fd) and [ripgrep](https://github.com/BurntSushi/ripgrep) installed.\nIf you want to use compression, you will need to have [lz4](https://github.com/lz4/lz4) in your system.\n\n## Usage\n\nTo create/update the index with kokatu, you just need to run the script with the option `-u`.\nYou may be required to run this as root if you don't have read permissions of your user for the files selected by the `\u003cstart-path\u003e`.\n\nTo search for an entry, you need to run the script with the pattern you want to search, `kokatu \u003cpattern\u003e`.\n\n```bash\n# Create/Update database\n$ sudo kokatu -u\n\n# Search for pattern 'README.md'\n$ kokatu README.md\n```\n\n## Options\n\nThe currently supported options are:\n\n- **-d \\\u003cdatabase-path\\\u003e**  - It overwrites the default path of the database/index [default: /tmp/kokatu.db]\n- **-p \\\u003cstart-path\\\u003e**     - It overwrites the default start path of the files to index [default: /]\n- **-u**                    - It updates/creates the database\n- **-c**                    - Return the number of matches, instead of the matches themselves\n- **-i**                    - Ignore case when searching\n- **-v**                    - Verbose\n\n## Compression\n\nBy default, kokatu doesn't compresses the index, however this can be enabled by changing the [following line](https://github.com/dedukun/kokatu/blob/master/kokatu#L9).\n\n```diff\ndiff --git a/kokatu b/kokatu\n--- a/kokatu\n+++ b/kokatu\n@@ -6,7 +6,7 @@\n\n kokatu_db=\"/tmp/kokatu.db\"\n\n-compression=\"\"\n+compression=\"Y\"\n verbose=\"\"\n\n rg_options=\"-z\"\n```\n\n## Performance\n\nThe following performance times were measured using [hyperfine](https://github.com/sharkdp/hyperfine), with the command:\n```bash\n$ hyperfine --warmup 3 \"locate README.md\" \"kokatu -d /tmp/kokatu.db README.md\" \"kokatu -d /tmp/kokatu_compressed.db.lz4 README.md\"\n```\n\nThe conditions of the indexes where the following:\n\n| Program                   | Database Size | Number of entries |\n|---------------------------|---------------|-------------------|\n| mlocate                   | 34M           | 1122686           |\n| kokatu (no compression)   | 103M          | 1199505           |\n| kokatu (with compression) | 15M           | 1199505           |\n\n![](images/performance.png?raw=true)\n\n## TODO\n\n- Configuration file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedukun%2Fkokatu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdedukun%2Fkokatu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdedukun%2Fkokatu/lists"}