https://github.com/fredlackey/recursive-unzip-bash-macos
Set of BASH functions to allow recursive unzipping of files.
https://github.com/fredlackey/recursive-unzip-bash-macos
Last synced: 2 months ago
JSON representation
Set of BASH functions to allow recursive unzipping of files.
- Host: GitHub
- URL: https://github.com/fredlackey/recursive-unzip-bash-macos
- Owner: FredLackey
- License: apache-2.0
- Created: 2024-02-19T12:45:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-19T13:16:57.000Z (over 1 year ago)
- Last Synced: 2025-01-24T10:30:28.406Z (4 months ago)
- Language: Shell
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Recursive Unzip Using BASH in MacOS (`recursive-unzip-bash-macos`)
Set of four BASH functions that can be used independently or together. When used together they recursively unzip files and remove the original zip files. Sometimes a zip file can contain other zip files. This set of functions will unzip all files in a directory and its subdirectories and then delete the original zip files.
## General Instructions
Your environment will most certainly be different than mine. In my case, I have a `~/.bash_functions` file where all of my BASH functions are stored. I then source this file in my `~/.bash_profile` file. You may only have a `~/.bashrc` file. If so, you could simply add these functions to that file. If you have neither, you could create a `~/.bash_functions` file and source it in your `~/.bashrc` file. The choice is yours.
## Terminology & Definitions
### Unzipped
For a file to be considered "unzipped" a folder of the same name must exist in the same location. When unzipped, the file `my_archive.zip` will be seen as:
```bash
my_archive.zip
my_archive/
```## Functions
### `count-unzipped`
Takes a directory as an argument and returns a count of the number of unzipped files in the directory and its subdirectories.
```bash
Usage: delete-unzipped
```### `delete-unzipped`
Takes a directory as an argument and deletes all unzipped files in the directory and its subdirectories.
```bash
Usage: delete-unzipped
```### `unzip-zips`
Takes a directory as an argument and unzips all zip files in the directory and its subdirectories.
```bash
Usage: unzip-zips
```### `recursive-unzip`
Takes a directory as an argument and unzips all zip files in the directory and its subdirectories and then deletes the original zip files.
```bash
Usage: recursive-unzip
```## Contact
If you have any questions, comments, or concerns, please feel free to reach out.
**Fred Lackey**
[[email protected]](mailto:[email protected])
[https://fredlackey.com](https://fredlackey.com)