coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature request: Rename files with a decent name if two files have t


From: Gregory Heytings
Subject: Re: Feature request: Rename files with a decent name if two files have the same name.
Date: Mon, 05 Dec 2022 16:05:33 +0000



I'm using the shell every day but there is one thing that terribly annoys me.

When moving files, if two files have the same name, you can overwrite it with the default behavior, not move the file with -n or choose between the two with -i, from my understanding the is no way to tell mv to rename the file to avoid the overwrite with a decent name like img_2.jpg for img.jpg

Can you add this feature to mv?


You can use the --backup option.  For example,

mv --force --backup=t foo bar

will make a backup of bar in bar.~1~ before overwriting bar with foo.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]