Writing first python helloworld program

If you have following installation / development environment setup steps from python page, to install python ( preferably python3 since its latest version ) . Its now time to write very first python program obviously helloworld python. $ vim helloworld.py #!/usr/bin/env python print (“Hello World”) Here, we created a file helloworld.py , notice the extension … Read more

How to Install Python on Linux / Ubuntu ?

If you have just now started looking into python, the first thing you need to do is install python on your development machine. If you are working on Windows, please check our another post “How to install Python on Windows” This post helps you to install python on Ubuntu. Installation of Python 2 To install … Read more

Multiple line comment in bash / shell script

In bash script, if we want to comment a single line, we just need to add # at the start of the line, like below Now, but in certain scenarios we need to put multiple line comments, like some description of what the script is for, OR just need to disable some section of code … Read more

Shell script to find a file and delete from a directory

Below shell script will find and delete certain file or multiple files from the directory you want. We have used current directory from where script is run, you need to change DIR_TO_SEARCH and FILE_TO_SEARCH_N_DEL from below script. In above script, you can change “DIR_to_SEARCH” to point to your directory where you need to search file … Read more

How to use getopts to accept variable arguments for bash script

getopts allows you to accept command line arguments for the bash script, below is demo script which does following this, You can run the script as, bash scriptname.sh -h => it will display the help bash scriptname.sh -c =>  script displays “Good Morning / Good after noon/ Good Evening / Good NIght” if the time … Read more