Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Filter and mass rename files in a directory or subdirectories with regular expressions.
Add this line to your application's Gemfile:
gem 'mass_rename'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mass_rename
Usage: mass_rename [options]
-d, --dir NAME Select a different working directory
-f, --filter PATTERN Filter files using a regular expression
-r, --replace PATTERN Replace matched file names with a replacement string
--recursive Select files in the target directory and all its subdirectories
-v, --version Display version
-h, --help Print this help
This tool is essentially a multi-string gsub, so treat the filter and replacement patterns the same as you would when using gsub -- capture groups and back references are very helpful!
The following example will recursively rename files matching the pattern "some_file_pattern_(\d)", capture the digit character, and rename all matching files with the replacement "\1_new_name", using a back reference for the captured digit.
mass_rename --recursive -d target_dir -f "some_file_pattern_(\d)" -r "\1_new_name"
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests.
You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/lucis-fluxum/mass_rename.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that mass_rename demonstrated a not healthy version release cadence and project activity because the last version was released 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.