I need to write a bash-script which will find all files with name string.h on the computer and copy them to some folder. My code is here:
#!/bin/bash
sudo find / -type f -name "string.h" -exec cp {} $HOME/MyDocuments \;
But during the execution of the script, I get error-messages on my console terminal "permission denied". How I can avoid getting this message? Console terminal must be clear.