I have hundreds of directories, some nested in other directories, with tens of thousands of files. The files need to have a date/time stamp removed from them.
An example filename is Letter to Client 27May2016~20160531-162719.pdf
and I would like for it to go back to being Letter to Client 27May2016.pdf
Another example filename is ABCDEF~20160531-162719
and I would like for it to go back to being ABCDEF
. Note that this file has no extension, unlike the example above.
I need a command that I can run at the root of the affected folders that will recursively go through and find/fix the filenames.
( I use Syncthing to sync files, and restored deleted files by copying them from the .stversions
directory back to where they were, but found that Syncthing appends that date/time stamp...)