execute a command recursively on the files of a folder in the matching location, not in the original one
3
votes
4
answers
2426
views
I want to recursively convert files from
.docx
to .doc
in a folder. The problem is that all the output files are created in the folder where I run the following command, not in the location of the source files:
find -type f -name "*.docx"-exec libreoffice --convert-to doc {} \;
I understand that find gives source files to the libreoffice
command and the output obviously has to be in the current location, so how can I use a command to loop recursively into a folder and execute the command from the location where the files is found, not the initial one?
Asked by fich
(340 rep)
Oct 22, 2022, 05:20 PM
Last activity: Aug 25, 2023, 10:39 AM
Last activity: Aug 25, 2023, 10:39 AM