https://github.com/dmuth/index-zip-files
A collection of scripts to index the filenames from ZIP files to allow for easy searching
https://github.com/dmuth/index-zip-files
Last synced: 8 months ago
JSON representation
A collection of scripts to index the filenames from ZIP files to allow for easy searching
- Host: GitHub
- URL: https://github.com/dmuth/index-zip-files
- Owner: dmuth
- License: apache-2.0
- Created: 2022-06-25T21:36:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-05T02:01:04.000Z (about 2 years ago)
- Last Synced: 2024-06-05T03:24:23.497Z (about 2 years ago)
- Language: Shell
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Index ZIP Files

What this does: Imagine you have hundreds of ZIP files and you want to find a specific file in one of them, without unzipping each file. This makes that possible.
What this does not do: This does not index the content of each ZIP file.
## Usage
Clone this repo, then run the various scripts like this:
- `./zip-index SOURCE_DIR`
- `./zip-list SOURCE_DIR`
- `./zip-search SOURCE_DIR string`
This is built to be fast, so no filename sorting is done at any point. If you want sorting, pipe into the `sort` command. :-)
If you would like to be able to run this app from anywhere in your filesystem, you'll want to...
### Creating Aliases
Running `./zip-aliases SOURCE_DIR ALIAS_KEY` will emit a series of aliases that can be used to index, list, and search ZIP files.
Example:
```
./zip-aliases ~/Dropbox/ dropbox
#
# Generating aliases tied to this installation and source directory
#
# Source Directory: /Users/doug/Dropbox
# Alias Key: dropbox
#
alias zip-index-dropbox="$HOME/development/index-zip-files/zip-index $HOME/Dropbox"
alias zip-list-dropbox="$HOME/development/index-zip-files/zip-list $HOME/Dropbox"
alias zip-search-dropbox="$HOME/development/index-zip-files/zip-search $HOME/Dropbox"
```
Once you paste those three alias lines in shell, typing `zip-index-dropbox` from any directory will index your Dropbox folder's ZIP files, and `zip-search-dropbox` can be used to search it. And yes, aliases autocomplete in bash. :-)
## Terminology
- ZIP File: A compressed archive containing 1 or more files.
- Index directory: A directory under `indexed-files/` in the directory you indexed, which containes index files for a specific Source directory.
- Index file: A plaintext file containing filenames of a single ZIP file.
## Testing and Development
- Running `./test.sh` will run `zip-create-test-files` to build a sample directory structure containing ZIP files and then
## Get in touch
I'm a software engineer based out of Philadelphia, PA. You can find me on [Twitter](https://twitter.com/dmuth), [Facebook](https://facebook.com/dmuth) and [on my blog](https://www.dmuth.org/). Feel free to drop by and say hi!