Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Batch rename files and folders.
Install node then:
$ npm install -g renamer
Linux/Mac users may need to run the above with sudo
Usage
$ renamer <options> <files>
-f, --find <undefined> The find string, or regular expression when --regex is set.
If not set, the whole filename will be replaced.
-r, --replace <undefined> The replace string. With --regex set, --replace can reference
parenthesised substrings from --find with $1, $2, $3 etc.
If omitted, defaults to a blank string. The special token
'{{index}}' will insert an incrementing number per file
processed.
-e, --regex When set, --find is intepreted as a regular expression.
-d, --dry-run Used for test runs. Set this to do everything but rename the file.
-i, --insensitive Enable case-insensitive finds.
-v, --verbose Use to print additional information.
-h, --help Print usage instructions.
for more detailed instructions, visit https://github.com/75lb/renamer
For more information on Regular Expressions, see this useful guide.
Don't forget to test your rename first using --dry-run
!
Renamer comes with globbing support built in (provided by node-glob), enabling recursive operations. To recurse, use the **
wildcard where a directory name would appear to apply the meaning "any directory, including this one".
For example, this command operates on all js files in the current directory:
$ renamer --find this --replace that '*.js'
this command operates on all js files, recursively:
$ renamer --find this --replace that '**/*.js'
this command operates on all js files from the lib
directory downward:
$ renamer --find this --replace that 'lib/**/*.js'
Bash users without globstar will need to enclose the glob expression in quotes to prevent native file expansion, i.e. '**/*.js'
$ renamer --find '[bad]' --replace '[good]' *
Before | After |
---|---|
|
|
$ renamer --insensitive --find 'mpeg4' --replace 'mp4' *
Before | After |
---|---|
|
|
$ renamer --find 'Season 1 - ' *
Before | After |
---|---|
|
|
$ renamer --regex --find '.*_(\d+)_.*' --replace 'Video $1.mp4' *
Before | After |
---|---|
|
|
$ renamer --replace 'Image{{index}}.jpg' *
Before | After |
---|---|
|
|
$ renamer --regex --find '\.(?!\w+$)' --replace ' ' *
Before | After |
---|---|
|
|
$ renamer --regex --find '(data\d)(\.\w+)' --replace '$1 (checked by Lloyd)$2' *
Before | After |
---|---|
|
|
$ renamer --find 'pic' --replace 'photo' '**'
Before | After |
---|---|
|
|
$ renamer --regex --find '^' --replace 'good-' '**'
Before | After |
---|---|
|
|
FAQs
Rename files in bulk
We found that renamer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.