If I have input folder files_input that has subfilders like 01-2015, 02-2015, 03-2015 etc and all these subfolders have other subfolders. Each subfolder has only one file called index.html.
How can I copy all these index.html files into one folder called files_output so that they end up like separate files in the same folder. They should ofcourse be renamed and I have tried to use --backup for that...
I have tried
find files_input -name \*.html -exec cp --backup=t '{}' files_output \;
to get them numbered but that copies only one file and nothing else.
I don't know does that change anything but I'm using zsh, here are the versions:
$ zsh --version | head -1
zsh 5.0.2 (x86_64-pc-linux-gnu)
$ bash --version | head -1
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
$ cp --version | head -1
cp (GNU coreutils) 8.21
$ find --version | head -1
find (GNU findutils) 4.4.2
Ideas?
Edit:
Trying to run e.g. following
cp --backup=t files_input/01-2015/index.html files_output
five times in a row still gives me one index.html in files_output folder! Is cp broken ? Why don't I have five different files?
findare you running?