I'm using the below command in my script to perform a dos2unix
operation on the files which I copy from Windows to Linux. There are many files, so it takes a considerable amount of time to perform this operation.
I searched on the internet for optimizing this find and found that we can use xargs
with find
instead of -exec
to increase the performance, but I'm struggling to convert the below one to use with xargs
:
find /path_to_files/ -exec bash -c 'dos2unix -k -n "{}" tmp_file && mv tmp_file "{}"' \;
{}
in the shell code.