Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magnetikonline/make-lowercase-rename
Hacky PHP utility that spits out bash scripts that recursively rename upper-cased filenames to lowercase.
https://github.com/magnetikonline/make-lowercase-rename
bash hacky lowercase php utility
Last synced: about 2 months ago
JSON representation
Hacky PHP utility that spits out bash scripts that recursively rename upper-cased filenames to lowercase.
- Host: GitHub
- URL: https://github.com/magnetikonline/make-lowercase-rename
- Owner: magnetikonline
- License: mit
- Created: 2013-02-10T11:06:37.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2022-02-03T00:44:41.000Z (almost 3 years ago)
- Last Synced: 2023-03-26T13:42:25.607Z (almost 2 years ago)
- Topics: bash, hacky, lowercase, php, utility
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Make lowercase rename
Quick, dirty and *hacky* PHP script (with a terrible project name).
Given a source directory, spits out to the console a bash script to recursively rename uppercase filenames to lowercased versions - basically a bunch of `mv "sourcefile" "sourcefilelowercase"` commands. It **will not** modify directories, only the files within.
Something I needed to lowercase around 30,000 digital camera images on a NAS drive which has a rather limited toolchain (BusyBox).
I'm sure I could have done this directly on the NAS using bash, but it proved easier/quicker to:
- Cobble this together
- Run script over NFS share to the files in question
- SCP result over to NAS as bash script
- Run bash script directly on the NAS from it's BusyBox shellThis will be little to *zero* use for anyone else but me.
Tested under PHP 7.2.x.
## Usage
**Note:** The second optional argument `--move-temp` will first move the source file to a temp filename, then back to it's final lowercased filename. This defeats issues with broken filesystems, such as FAT32:
```sh
$ ./makelowercaserename.php \
"/path/to/files" [--move-temp] >"/path/to/outbash.sh"
```Or pass in an alternative command for `mv` via `MVCMD`:
```sh
$ MVCMD="git mv" \
./makelowercaserename.php \
"/path/to/files" [--move-temp] >"/path/to/outbash.sh"
```