Skip to content

A simple alternative to the mv command, designed to handle file renaming when a file with the target name already exists. move automatically adds an index or number to the file name to prevent conflicts. Lightweight and dependency-free.

Notifications You must be signed in to change notification settings

gauravnumber/move.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

move

GitHub tag (latest SemVer) Twitter Follow

mv command doesn't support renaming file (adding an index/number) when file already exists, so I created move.

move doesn't have any dependencies.

Install

npm i -g @gauravnumber/move

Usage

move <source_path> <destination_path>

Example

Initial Folder Structure

.
├── 1.txt
├── 2.txt
├── 3.txt
├── 4.txt
├── 5.txt
└── 6.txt

Execute the command below

move 1.txt 2.txt

2.txt file already exists, so move appends an index to the filename. After running above command, the folder structure looks like this.

.
├── 2_1.txt
├── 2.txt
├── 3.txt
├── 4.txt
├── 5.txt
└── 6.txt

About

A simple alternative to the mv command, designed to handle file renaming when a file with the target name already exists. move automatically adds an index or number to the file name to prevent conflicts. Lightweight and dependency-free.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published