Coder Social home page Coder Social logo

brn's Introduction

bulk rename files

brn is a command line tool similar to vimv. It can be used to easily mass-rename files in your preferred text editor (i.e. vim).

Usage

When called from inside a directory, it opens a buffer in your default text editor with the list of filenames. You can then edit the filenames in the buffer and the changes will take place when you save and exit.

By default it uses $EDITOR and if that is not set then $VISUAL.

Install

Arch Linux Users

You can use the brn-git aur package

paru -S brn-git

Everyone else

Clone the repo and

sudo make install

Why use brn over something like vimv?

  • It can handle swapping names. It uses GNU/Linux's renameat2 system call to atomically swap the names of two files which means no temporary files are made either (yes, this also means you can't compile it on other Unixes).

  • It is written in C instead of bash which makes its behavior more robust and predictable.

  • It has error handling, it will safely abort if the exact number of filenames isn't provided or if some filenames are repeated.

  • It is free.

Screencast

example gif

TODO

  • Make an AUR package.

  • Version sort directory listing so initial buffer is similar to output of ls -Av.

  • Add an example GIF

License

brn is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE.

brn's People

Contributors

nimaipatel avatar thereallorenz avatar

Stargazers

Ravioli avatar  avatar cherry-noize avatar Ashish Panigrahi avatar Darshil avatar  avatar tim avatar Luke Simmons avatar Robbie Cargill avatar Nikhil M Warrier avatar  avatar Jan Möller avatar  avatar chimay avatar  avatar Dmitry Simonov avatar

Watchers

 avatar  avatar

brn's Issues

Feature request: End message to show number of renamed files

Hi!

I've been using vimv for quite sometime now for bulk-renaming and brn works great! The only issue is that in vimv, after the bulk-renaming, a message is shown saying N files renamed..

I would be nice if this feature could also be implemented in brn.

Crash when running in a directory containing 8 files

When running brn in this git repository after running make, it crashes with the following error:

malloc(): invalid next size (unsorted)
[1]    85812 IOT instruction (core dumped)  brn

The directory looks like this:

.git
.gitignore
brn
brn.c
brn-example.gif
LICENSE
Makefile
README.md

I have not been able to reproduce the error in any other git repositories. The error disappears when any file is removed, or if another file is added to the repository. It does not occur on a fresh clone (with no brn executable) and also does not occur in other directories containing the brn executable. I know nothing about C so I'm not sure what could be causing this or how to debug further.

This is obviously not really affecting my workflow, I just noticed it because after installing I tried to test it out by renaming the readme, and got this error instead.

Thanks for brn, I'm finding it very useful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.