Anuj Kaushal

Posts Categorized / Bash

How to use “for” loop in one liner bash command

February 21, 2021 | Bash, Blog, Command | by anuj

There is always a need to running a command in the loop and it can be very useful if you don’t have to write a separate bash script to run command in loop.So here are some different ways to run loop in one liner command. Its very useful when you have to delete specific deployment […]

Shell script to deploy your code using SSH command

February 6, 2021 | Bash, Blog, Command, Hosting, Shell | by anuj

So we have awesome ways to deploy our latest code on cloud environments like Ansible, Puppet and there are also tools like Jenkins, Travis to make that more easy. But when it comes Shared hosting our options are very limited and most of the time you don’t have any option but to manually deploy the […]

Run this to reflect Magento 2 code changes

August 8, 2020 | Bash, Blog, Command, Magento | by anuj

So its very annoying when you change something in Magento 2 code and it change doesn’t reflect. As a practice i always run following commands to make sure magento is reflecting the latest code You can always enable developer mode but in my practice i want to rely on manual commands In case your website […]

How to open server bash inside local shell script

July 26, 2020 | Bash, Blog | by anuj

Its always tricky to start deployment operation on local and perform few steps on server bash and i was looking for a way to write all local and server commands inside a single deployment file. Finally i was able to do that using following code. The trick is open and close “SSHBASH” every command inside […]

Bash script to get HTTP response code from list of URL

May 12, 2020 | Bash, Blog | by anuj

While preparing list of active stores i had to create following script because the list of stores were in hundreds. Here is a simple bash script to read list of URLs from a text file and generate the output in a separate file with comma delimited.