Download wordpress core using bash script

Solution 1:

There is no need to specify the directory when using the WordPress CLI. Instead you go to the directory where the core is to be copied:

cd /var/www/public_html
sudo -u www-data wp core download

Using sudo -u www-data ensures the files are copied with the correct ownership.

From there, you can begin your WordPress installation.