YOU
YOU

Reputation: 333

Auto rename file when copy

I want to copy a file to another location by cp C:/code.txt D:/code.txt ,any way to auto rename to code(2).txt or another name ,if code.txt was exist in D directory .Thanks much for any help !

Upvotes: 2

Views: 5033

Answers (1)

YOU
YOU

Reputation: 333

I found this answer cp --backup=numbered C:/code.txt D:/code.txt .

Upvotes: 5

Related Questions