D
D
Damian Lewis2021-09-12 14:39:20
linux
Damian Lewis, 2021-09-12 14:39:20

Auto rename folders when copying?

When copying files, when there is a name match, the system usually offers options: replace the file or copy it, but with renaming. Can the same be done when copying folders? If when copying the "Photo" folder at the destination there will be the same "Photo" folder, then the folder that I copy will automatically be renamed relatively speaking to "Photo-1", thereby not affecting the "Photo" folder at the destination. Any options on Windows, Linux, Terminal, CMD or PowerShell systems will do.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xibir, 2021-09-12
@xibir

You can do this with a bash script

A
Alexey Dmitriev, 2021-09-12
@SignFinder

You can use a powershell script. For example, generate a list of existing folders and compare the name of each copied with it and rename if it matches.

M
Maxim Yaroshevich, 2021-09-23
@YMax

The disease is easier to prevent than to treat. A good habit is to create folders with the current date, if necessary - with the time of creation, for example, not "Photo", but "2021-09-21_10-30_Photo_kittens" - then there will be no such problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question