https://github.com/allenvox/renamer
Simple bash script for renaming input files of the same type
https://github.com/allenvox/renamer
bash rename rename-files script
Last synced: 11 months ago
JSON representation
Simple bash script for renaming input files of the same type
- Host: GitHub
- URL: https://github.com/allenvox/renamer
- Owner: allenvox
- License: mit
- Created: 2024-07-23T08:10:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-23T08:18:38.000Z (over 1 year ago)
- Last Synced: 2025-01-10T16:35:24.901Z (about 1 year ago)
- Topics: bash, rename, rename-files, script
- Language: Shell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Renamer - useful bash script for photographers

## Features
- Renames files in ascending order.
- Allows setting the starting number for renaming.
- Allows specifying the file type to rename.
## Usage
`./renamer.sh -a -t `
### Options
- `-a `: The number from which the renaming should start.
- `-t `: The file extension/type to rename without the dot character *(e.g. "JPG", not ".JPG")*.
### Example
To rename all `.JPG` files in the current directory starting from `0001.JPG`, run:
`./renamer.sh -a 1 -t JPG`
## Prerequisites
- Bash shell
## Installation
1. Clone the repository or download the script.
2. Make the script executable:
`chmod +x renamer.sh`
## How It Works
The script uses the `getopts` command to parse the command-line arguments and then renames files using a loop. The new filenames are generated in the format `XXXX.` where `XXXX` is a zero-padded number starting from the specified `starting_number`.