Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foiovituh/mfr
Rename all files in a directory using a specified pattern đ
https://github.com/foiovituh/mfr
filesystem go io rename-files rename-script renamer-utility
Last synced: about 1 month ago
JSON representation
Rename all files in a directory using a specified pattern đ
- Host: GitHub
- URL: https://github.com/foiovituh/mfr
- Owner: foiovituh
- License: mit
- Created: 2024-07-03T03:30:43.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-06T21:36:33.000Z (6 months ago)
- Last Synced: 2024-07-14T09:10:39.739Z (5 months ago)
- Topics: filesystem, go, io, rename-files, rename-script, renamer-utility
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MFR đ
Go program that renames all files in a directory using a specified pattern.## Requirements đ
OS:
- Linux
- Windows
- macOS (nÊe OS X, aka Darwin)
- OpenBSD
- DragonFly BSD
- FreeBSD
- NetBSD
- SolarisTo build:
- Go compiler## Quick usage guide đ
#### Build:
```
go build -o mfr cmd/main.go
```
> NOTE: Generate in the root directory of the project
---
#### Arguments:
```
-d=string
[REQUIRED] Full directory path to rename all files
-e=string
[OPTIONAL] Filter files containing the extension
-p=string
[OPTIONAL] Pattern to apply in the file renaming process (default "file-")```
---
#### Basic usage example:
```
./mfr -d=/home/you/test/
```- Before:
```
/home/you/test/
âââ text.txt
âââ image.png
âââ document.pdf
âââ program.java
```- After:
```
/home/you/test/
âââ file-1.txt
âââ file-2.png
âââ file-3.pdf
âââ file-4.java
```---
#### Example of pattern customization and extension filter:
```
./mfr -d=/home/you/test/ -p=photo -e=.png
```- Before:
```
/home/you/test/
âââ text.txt
âââ image.png
âââ other-image.png
âââ document.pdf
âââ program.java
```- After:
```
/home/you/test/
âââ text.txt
âââ photo-1.png
âââ photo-2.png
âââ document.pdf
âââ program.java
```## Future plans đ
- Write more tests
- Allow customized sorting
- Create a backup of the renamed files
- Ask for confirmation in important directories## Do you want help me? đĨ
If you have any ideas or wish to contribute to the project, contact me on X (@ohtoaki) or send me a pull request :)## License đŗī¸
```
MIT LicenseCopyright (c) 2024 Vitu Ohto
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```