Home

Awesome

put is an ISC-licensed command-line utility to move, rename, copy and symlink files. put uses a simple placeholder syntax to transform input filenames to output filenames. Think of it as an easier-to-use but perhaps less powerful Linux rename.

Usage

# copy files
put 'app/config/nginx/{type}' '/etc/nginx/{type}.conf'

# move or rename files
put --move 'music/{title} - {album} ({artist})' 'music/{artist} - {title}'

# symlink files
put --link 'posts/{year}/images/{slug}' 'build/images/{year}-{slug}'

Any intermediate directories that don't yet exist will be created for you. It acts like mkdir -p and rename glued together, if you will.

See put --help for more details.

Install using npm install put-cli -g. You'll need to have node.js installed for this to work.

Status

Works for me, but needs unit tests before it can be declared safe for public consumption.

Limitations and roadmap

Use from node.js

The put-cli library exposes copy, move and link functions. They all have the same interface:

fn(source, destination, options, callback)

Options and callback are optional.

For example:

var put = require('put');
var source = 'images/{year}-{description}-{width}x{height}';
var destination = 'images/{year}/{description}';
var options = {verbose: true};
put.move(source, destination, options, function(err) {
    console.log('done!');
});