Auto files creation for web development



If you are starting some basic web development project from scratch
and doesn't need any framework then you can run the following code to get started:


echo "Enter project name:"
read input

mkdir /var/www/html/$input
mkdir /var/www/html/$input/images
mkdir /var/www/html/$input/js
mkdir /var/www/html/$input/css
mkdir /var/www/html/$input/fonts

touch /var/www/html/$input/index.html
touch /var/www/html/$input/js/main.js
touch /var/www/html/$input/css/style.css


Save the above code in file with .sh extension (Example createFiles.sh )

Give permission to html folder where files will be created:
sudo chmod -R 777 /var/www/html/

Now run the above file created in terminal using below command:
bash createFiles.sh

Voilà!  Now go to directory /var/www/html/ here you'll see all folders and files created.
 Now you can start working on your project
Previous Post Next Post