Skip to content

wulffeld/cp_unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cp_unique

A tool to copy/move files but as opposed to standard cp/mv it will create uniquely named duplicate files in the destination directory in case of a filename clash.

How it Works

cp_unique will copy (or move) files to the destination directory. If a file with the same name exists in the destination the file will be checked for equality using SHA256. If the files are identical the source file will be removed. If the files are different the source file will be renamed to a unique name and copied to the destination directory.

Options

  • -d: Move the files instead of copying them.
  • -f: Force delete of source identical files without asking (implies -d).

Usage

cp_unique <source> <target>

Using the -d option will move the files instead of copying them.

cp_unique -d <source> <target>

Caveat Emptor

This is a fairly destructive command to use. Make sure you understand what it's doing before you use it.

The author is not an experienced Golang developer so tread lightly.

Tests are potentially upcoming.

About

Simple tool to cp/mv files in a very specific way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages