To create a new bash script file using the touch command in Linux, you can follow these steps:
Open a terminal window.
Navigate to the directory where you want to create the script file.
Type the following command:
touch pull.sh
This will create a new file named "script.sh" in the current directory.
To make the file executable, you need to give it execute permissions. You can do this using the following command:
chmod +x pull.sh
Now you can open the file in a text editor, such as nano or vi, and add your bash commands to the file. For example, you could add the following command to print "Hello, world!" to the terminal:
echo "php artisan config:clear"
echo "php artisan migrate:install"
git pull origin master
php artisan c:cache
php artisan r:cache
php artisan v:clear
chown -R daemon:daemon
Once you've added your commands, save the file and close the text editor.
Your bash script file is now ready to be executed by running the following command in the terminal:
./pull.sh
Top comments (0)