Created
January 13, 2020 09:08
-
-
Save aliaramli/8c3bfc2fd3a19b0f0af030414a3d5f66 to your computer and use it in GitHub Desktop.
Steps to create Wordpress uploads folders using bash command Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. create the folder of the year in your wordpress project folder | |
mkdir -p /project_folder/wp-content/uploads/2020 | |
# 2. then create child folders for every month!!!!! | |
#this is for 01-09 | |
for i in {1..9}; do mkdir -p /project_folder/wp-content/uploads/2020/0$i; done | |
#this is for 10-12 | |
for i in {0..2}; do mkdir -p /project_folder/wp-content/uploads/2020/1$i; done | |
# 3. eh dont forgot to change the ownership of the folders! im using nginx... | |
# sooooo my command looks something like this :D | |
chown -R www-data:www-data /project_folder/wp-content/uploads/2020 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment